Repository navigation
[fix][test] Fix flaky V5DagWatchAutoReconnectTest producer test - #26510
Merged
nodece merged 2 commits intoSep 9, 2026
Merged
Conversation
### Motivation testProducerSurvivesDagWatchConnectionDrop in V5DagWatchAutoReconnectTest is flaky: the exact-set assertion intermittently fails with "producer must keep sending after DAG watch reconnect kicks in". The test force-closes the producer's DAG-watch channel, but with the default connectionsPerBroker=1 the v5 client pools a single connection per broker, so that channel is the shared connection for the whole client. The consumer's segment consumers ride the same connection and reconnect alongside the producer; around that window the broker can redeliver first-batch messages (at-least-once), which pollutes the second drain and makes the exact-set assertion timing-dependent. ### Modifications - Create the consumer on its own dedicated client (newV5Client()) so the force-close is scoped to the producer's connections. The producer's segment producers still drop and reconnect (sends queue and flush), but the consumer stays connected, removing the reconnect/redelivery race and making the assertion deterministic. Assisted-by: Codex (OpenAI)
Technoboy-
approved these changes
Sep 9, 2026
…nectTest Document why the second batch still succeeds: the force-close also drops the shared client connection, so the per-segment v4 producers reconnect and sends issued in the window are queued and flushed once the connection is re-established. Assisted-by: Codex (OpenAI)
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
testProducerSurvivesDagWatchConnectionDropinV5DagWatchAutoReconnectTestis flaky: the exact-set assertion intermittently fails withproducer must keep sending after DAG watch reconnect kicks in.The test force-closes the producer's DAG-watch channel, but with the default
connectionsPerBroker=1the v5 client pools a single connection per broker, so that channel is the shared connection for the whole client. The consumer's segment consumers ride the same connection and reconnect alongside the producer; around that window the broker can redeliver first-batch messages (at-least-once semantics), which pollutes the seconddrainand makes the exact-set assertion timing-dependent.Modifications
newV5Client()) so the force-close is scoped to the producer's connections only. The producer's segment producers still drop and reconnect (sends issued in the window are queued and flushed once the connection is re-established), but the consumer stays connected — removing the reconnect/redelivery race and making the assertion deterministic.Verifying this change
This change updates an existing test and can be verified by running:
BUILD SUCCESSFUL,:pulsar-broker:checkstyleTestclean).Does this pull request potentially affect one of the following parts:
Documentation
doc-requireddoc-not-neededdocdoc-omitted