Repository navigation
[fix][broker] Fix silently dropped acknowledgement failures in PulsarMetadataEventSynchronizer - #26237
Merged
lhotari merged 1 commit intoJul 25, 2026
Conversation
Dream95
reviewed
Jul 25, 2026
…MetadataEventSynchronizer
SongOf
force-pushed
the
fix/broker-metadata-synchronizer-ack-future
branch
from
July 25, 2026 09:25
8b45e32 to
c3a1fc5
Compare
lhotari
approved these changes
Jul 25, 2026
lhotari
pushed a commit
that referenced
this pull request
Jul 25, 2026
…MetadataEventSynchronizer (#26237) Co-authored-by: maxlisongsong <[email protected]> (cherry picked from commit c6fd26f)
lhotari
pushed a commit
that referenced
this pull request
Jul 25, 2026
…MetadataEventSynchronizer (#26237) Co-authored-by: maxlisongsong <[email protected]> (cherry picked from commit c6fd26f)
sandeep-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 31, 2026
…MetadataEventSynchronizer (apache#26237) Co-authored-by: maxlisongsong <[email protected]> (cherry picked from commit c6fd26f)
sandeep-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 31, 2026
…MetadataEventSynchronizer (apache#26237) Co-authored-by: maxlisongsong <[email protected]> (cherry picked from commit c6fd26f)
sandeep-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 31, 2026
…MetadataEventSynchronizer (apache#26237) Co-authored-by: maxlisongsong <[email protected]> (cherry picked from commit c6fd26f)
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Aug 28, 2026
…MetadataEventSynchronizer (apache#26237) Co-authored-by: maxlisongsong <[email protected]> (cherry picked from commit c6fd26f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
PulsarMetadataEventSynchronizer.startConsumer()'s messageListener acknowledged consumed MetadataEvent messages with .thenApply(__ -> c.acknowledgeAsync(msg)). Since acknowledgeAsync itself returns a CompletableFuture, thenApply treated that return value as plain data instead of composing on it: the outer future completed as soon as the metadata event was applied to the local store, without ever waiting for the acknowledgement to actually finish.
As a result, if acknowledgeAsync later failed asynchronously (e.g. a connection issue while sending the ack command), the exception was never observed by the attached .exceptionally() handler and was silently dropped — no log
signal, with recovery relying entirely on the 60s ackTimeout redelivering the same event. The zero-listener branch had the same problem in an even more direct form: acknowledgeAsync was called with no error handling attached at all.
Modifications
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
(Note: the fix was manually verified locally with a temporary unit test that mocked Consumer.acknowledgeAsync and asserted the returned future doesn't settle until the ack future completes — confirmed it failed against the
original thenApply shape and passed after switching to thenCompose. That test was not included in this PR.)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes