origin_server_auth: Improve log messages - #13553
Conversation
The original message didn't say what could be wrong at all. What manual reloading mean is unclear and it's not always the right action.
There was a problem hiding this comment.
Pull request overview
This pull request updates Apache Traffic Server’s origin_server_auth plugin to provide a clearer TSError log message when automatic config reloads continue encountering a stale/expired configuration.
Changes:
- Reworded the periodic error log emitted during repeated stale-config reload checks to be more descriptive and include an attempt counter.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
plugins/origin_server_auth/origin_server_auth.cc:1189
incr_conf_reload_count()returns the pre-increment value (post-increment), so the current code logs on attempts 1, 11, 21, ... and prints an off-by-one attempt count. Capture the incremented attempt number explicitly so the log cadence and the displayed attempt count match (e.g., every 10th attempt prints 10, 20, ...).
if (s3->incr_conf_reload_count() % 10 == 0) {
TSError("[%s] Reloading a stale config file has been failing (%d attempts): %s", PLUGIN_NAME, s3->get_conf_reload_count(),
config_fname.c_str());
plugins/origin_server_auth/origin_server_auth.cc:441
get_conf_reload_count()should be markedconstfor consistency with other accessors in this class (e.g.,expiration() const,conf_fname() const) and to prevent accidental mutation expectations.
This issue also appears on line 1187 of the same file.
int
get_conf_reload_count()
{
return _conf_reload_count;
}
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
plugins/origin_server_auth/origin_server_auth.cc:435
incr_conf_reload_count()uses post-increment, which makes the retry counter used inconfig_reloader()off-by-one (e.g., the first log happens at 1 attempt, then 11, 21...). Switching to pre-increment makes both the modulo check and the logged attempt count align with the actual number of tries sincereset_conf_reload_count().
int
incr_conf_reload_count()
{
return _conf_reload_count++;
}
plugins/origin_server_auth/origin_server_auth.cc:441
get_conf_reload_count()does not modify state and should be markedconstso it can be called on constS3Configinstances and to reflect its accessor semantics.
int
get_conf_reload_count()
{
return _conf_reload_count;
}
The original message didn't say what could be wrong at all. What manual reloading mean is unclear and it's not always the right action.