Fix race condition in KeyProducerJavaZmqTest message delivery#149
Merged
bernardladenthin merged 1 commit intomainfrom Apr 2, 2026
Merged
Fix race condition in KeyProducerJavaZmqTest message delivery#149bernardladenthin merged 1 commit intomainfrom
bernardladenthin merged 1 commit intomainfrom
Conversation
The senderReady latch was counting down BEFORE socket.send(), so createSecrets() could start polling the queue before the ZMQ message was even sent. On loaded Windows CI runners, this caused the 2-second poll timeout to expire before the message arrived. Fix: move senderReady.countDown() to AFTER send() plus an additional establish delay, ensuring the message has been sent and had time to travel through ZMQ before createSecrets() begins polling. https://claude.ai/code/session_018nK6z7Ax5DwUTh2VhQqhbW
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
============================================
- Coverage 74.50% 74.46% -0.05%
+ Complexity 562 561 -1
============================================
Files 84 84
Lines 2428 2428
Branches 208 208
============================================
- Hits 1809 1808 -1
Misses 564 564
- Partials 55 56 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.



Summary
Fixed a race condition in the ZMQ socket test where the consumer could start reading before the message was fully delivered by the sender.
Key Changes
senderReady.countDown()to after the message is sent and a delivery delay is appliedsocket.send()to ensure the message is delivered before the consumer starts readingImplementation Details
The test was previously signaling readiness immediately after sending the message without waiting for delivery. This could cause the consumer thread to start reading before ZMQ had fully delivered the message through the socket. By adding a delay after
socket.send()and moving the countdown after that delay, we ensure proper synchronization between the sender and consumer threads.https://claude.ai/code/session_018nK6z7Ax5DwUTh2VhQqhbW