Skip to content

origin_server_auth: Improve log messages - #13553

Open
maskit wants to merge 3 commits into
apache:masterfrom
maskit:osa_improve_error_message
Open

origin_server_auth: Improve log messages#13553
maskit wants to merge 3 commits into
apache:masterfrom
maskit:osa_improve_error_message

Conversation

@maskit

@maskit maskit commented Aug 14, 2026

Copy link
Copy Markdown
Member

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.

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.
@maskit maskit added this to the 11.0.0 milestone Aug 14, 2026
@maskit maskit self-assigned this Aug 14, 2026
@maskit maskit added the origin_server_auth origin_server_auth plugin label Aug 14, 2026
Copilot AI lite review requested due to automatic review settings August 14, 2026 21:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread plugins/origin_server_auth/origin_server_auth.cc
Copilot AI review requested due to automatic review settings August 14, 2026 21:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 marked const for 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;
  }

Copilot AI review requested due to automatic review settings August 14, 2026 21:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in config_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 since reset_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 marked const so it can be called on const S3Config instances and to reflect its accessor semantics.
  int
  get_conf_reload_count()
  {
    return _conf_reload_count;
  }

@maskit maskit changed the title origin_server_auth: Improve an error message origin_server_auth: Improve log messages Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin_server_auth origin_server_auth plugin

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants