Skip to content

fix: remove dangling placeholder from event source close warning - #3532

Draft
csviri wants to merge 1 commit into
operator-framework:mainfrom
csviri:fix/logging-lost-stack-traces
Draft

fix: remove dangling placeholder from event source close warning#3532
csviri wants to merge 1 commit into
operator-framework:mainfrom
csviri:fix/logging-lost-stack-traces

Conversation

@csviri

@csviri csviri commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

log.warn("Error closing {} -> {}", eventSource.name(), e) supplies two
placeholders but only one non-throwable argument. SLF4J trims a trailing
Throwable and reports it as the exception, so the stack trace is logged
correctly, but the second placeholder is left unfilled and the message
renders with a literal brace pair:

Error closing myEventSource -> {}

Drops the redundant placeholder and names what is being logged.

Note: the superficially similar calls in InformerManager.stop and
InformerWrapper.start are correct as they stand - they pass more
non-throwable arguments than placeholders, so nothing is left dangling.

Part of #3517

`log.warn("Error closing {} -> {}", eventSource.name(), e)` supplies two
placeholders but only one non-throwable argument. SLF4J trims a trailing
`Throwable` and reports it as the exception, so the stack trace is logged
correctly, but the second placeholder is left unfilled and the message
renders with a literal brace pair:

    Error closing myEventSource -> {}

Drops the redundant placeholder and names what is being logged.

Note: the superficially similar calls in `InformerManager.stop` and
`InformerWrapper.start` are correct as they stand - they pass more
non-throwable arguments than placeholders, so nothing is left dangling.
Copilot AI review requested due to automatic review settings July 30, 2026 09:05
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 30, 2026

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 PR fixes a logging-formatting issue in EventSourceManager where a SLF4J warning message had one placeholder too many, causing the rendered log line to include a literal {} when stopping an event source fails.

Changes:

  • Remove the redundant placeholder from the “error closing” warning.
  • Update the message text to explicitly name what is being closed (“event source”) while preserving exception logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants