Skip to content

[fix][broker] Log exception in PulsarMetadataEventSynchronizer failure path#26203

Open
SongOf wants to merge 1 commit into
apache:masterfrom
SongOf:fix/metadata-event-synchronizer-log
Open

[fix][broker] Log exception in PulsarMetadataEventSynchronizer failure path#26203
SongOf wants to merge 1 commit into
apache:masterfrom
SongOf:fix/metadata-event-synchronizer-log

Conversation

@SongOf

@SongOf SongOf commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

In PulsarMetadataEventSynchronizer, the message listener has three failure paths (single-listener
exceptionally, multi-listener waitForAll exceptionally, and the surrounding catch block).
All three logged the warning "Failed to synchronize for" without attaching the caught exception,
so when metadata-event synchronization failed there was no stack trace or error cause in the broker
log, making the failure impossible to diagnose. The message text was also truncated/incomplete.

Modifications

  • Attach the caught exception to the slog warn call via .exception(ex) / .exception(e) in all
    three failure paths of the metadata-event message listener in PulsarMetadataEventSynchronizer.
  • Fix the incomplete log message: "Failed to synchronize for""Failed to synchronize metadata event".

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants