(fix/test) flaky testAdvisoryForwardingDuplexNC#1832
Merged
jbonofre merged 1 commit intoapache:mainfrom Mar 26, 2026
Merged
Conversation
jbonofre
approved these changes
Mar 25, 2026
| networkBridge.setDuplex(true); | ||
| startAllBrokers(); | ||
| verifyPeerBrokerInfo(brokers.get("A"), 1); | ||
| verifyPeerBrokerInfo(brokers.get("B"), 1); |
Member
There was a problem hiding this comment.
Good catch.
In a duplex connector, Broker A initiates the connection but Broker B must also establish a sub-bridge for the reverse path. The existing code only waited for A's peer info, creating a race where advisories sent before B's bridge was ready would be silently dropped (fire-and-forget semantics).
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.
Description:
In a Duplex Network Connector configuration, Broker A initiates the connection, but Broker B must then initialize a sub-bridge for the reverse path. If messages are sent immediately after Broker A reports a connection, the reverse path on Broker B may not yet be fully established. Since Advisory messages are non-persistent and "fire-and-forget," they are dropped if the bridge demand/metadata exchange is incomplete.
Adding a verification step for Broker B ensures that both sides of the duplex transport have completed their BrokerInfo exchange and are ready to forward advisories before the test producer is started.
Error:
Testing:
Ran testAdvisoryForwardingDuplexNC 30 times locally; 100% pass rate after the fix (previously failed ~70% of the time).