Skip to content

Avoid logging stack trace during expected remote-config exception#11328

Open
sarahchen6 wants to merge 2 commits intomasterfrom
sarahchen6/apms-19495
Open

Avoid logging stack trace during expected remote-config exception#11328
sarahchen6 wants to merge 2 commits intomasterfrom
sarahchen6/apms-19495

Conversation

@sarahchen6
Copy link
Copy Markdown
Contributor

@sarahchen6 sarahchen6 commented May 8, 2026

What Does This Do

Avoid logging the full stack trace during an expected remote-config exception. Instead log just the exception class and message.

Motivation

This exception occurs when the tracer's selector get closed mid-poll which is often the case when the pod is shutdown. Since this exception is expected, avoid logging a full stack trace and unnecessarily alarming users.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

@sarahchen6 sarahchen6 requested a review from a team as a code owner May 8, 2026 17:28
@sarahchen6 sarahchen6 added the type: enhancement Enhancements and improvements label May 8, 2026
@sarahchen6 sarahchen6 requested review from dougqh and removed request for a team May 8, 2026 17:28
@sarahchen6 sarahchen6 added the comp: remote config Configuration at Runtime label May 8, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd76457b77

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

} catch (Exception e) {
// no error can be reported, as we don't have the data client.state.targets_version avail
ratelimitedLogger.warn("Error parsing remote config response", e);
ratelimitedLogger.warn("Error parsing remote config response: {}", e.toString());
Copy link
Copy Markdown
Contributor

@dougqh dougqh May 8, 2026

Choose a reason for hiding this comment

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

e.getMessage() might be better.

I'm also not sure if we still want to pass the exception somehow for exception metric reporting purposes. I've always thought we should have a helper that handles this better.

Something like warnExpected / warnQuielty?. Although, I guess use of a rateLimitedLogger is itself an indication that an exception is expected here.

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.

Also worth thinking about whether, all Exceptions are expecting or only a subset.

Copy link
Copy Markdown
Contributor Author

@sarahchen6 sarahchen6 May 8, 2026

Choose a reason for hiding this comment

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

Sounds good. It looks like ClosedSelectorExceptions are what's expected when selectors are closed mid-poll, so I'll update those exceptions specifically to use e.getMessage().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 0e6bdee!

@sarahchen6 sarahchen6 force-pushed the sarahchen6/apms-19495 branch from b22d2bc to 0e6bdee Compare May 8, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: remote config Configuration at Runtime type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants