Repository navigation
Conversation
Contributor
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
📋 Review Summary
This PR resolves two recurring test-fixture issues in CommonJms and JmsIOIT: an ActiveMQ advisory topic lazy-initialization NullPointerException race under concurrent vm:// connections, and a 60-second hang in Qpid JMS receiveNoWait() when using non-zero prefetch against ActiveMQ 5.x over AMQP. The changes are minimal, well-scoped to the test infrastructure, and properly preserve synchronous behavior for unit tests in JmsIOTest.
🔍 General Feedback
- Disabling
advisorySupporton the embeddedBrokerServiceinCommonJms.startBroker()cleanly avoids the unsynchronized destination path initialization race onTEMP_DESTINATION_COMPOSITE_ADVISORY_TOPICwithout affecting test coverage. - Adding
createConnectionFactoryWithLocalReceiveNoWait()withjms.receiveNoWaitLocalOnly=trueforamqp://connections inJmsIOITdirectly addresses the unacknowledged message timeout caused by ActiveMQ 5.x ignoring AMQP drain pulls when prefetch is enabled.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
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.
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:
Full details of the methodology of generation and review can be found here - https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)
Summary
Fixes two recurring test-fixture bugs in
JmsIOIT/CommonJms(PreCommit Java Jms IO Direct):CommonJms.startBroker()to eliminate concurrentvm://localhostNullPointerExceptionraces.jms.receiveNoWaitLocalOnly=trueon Qpid AMQP connections used byJmsIOITfor non-CLIENT_ACKNOWLEDGEmodes to preventreceiveNoWait()from hanging for 60 seconds on ActiveMQ 5.x's ignored AMQP drain pull.Root Cause
vm://localhost):CommonJms.startBroker()leftadvisorySupportenabled (the ActiveMQ default). When 16 DirectRunner worker threads startActiveMQConnectioninstances concurrently overvm://localhost, ActiveMQ's unsynchronized lazy initialization ofActiveMQDestination.getDestinationPaths()onAdvisorySupport.TEMP_DESTINATION_COMPOSITE_ADVISORY_TOPICcan throw aNullPointerExceptioninDestinationMapNode.appendMatchingValues.receiveNoWait()60s drain hang (amqp://localhost): ForINDIVIDUAL_ACKNOWLEDGEandCLIENT_ACKNOWLEDGE_UNSAFE,JmsIOITuses default prefetch (1000). Once all 10,000 messages have been consumed and the local prefetch buffer is empty,JmsIO.UnboundedJmsReader.advance()callsconsumer.receiveNoWait(). With Qpid JMS's defaultjms.receiveNoWaitLocalOnly=false, Qpid issues an AMQPFLOW(drain=true)pull; ActiveMQ 5.x'sPrefetchSubscription.pullMessage()ignoresMessagePullwheneverprefetchSize > 0, soreceiveNoWait()blocks for the full 60-secondamqp.drainTimeout. That prevents DirectRunner from finishing the bundle and finalizingJmsCheckpointMarkto acknowledge the messages beforeJmsIOIT's 60sreadTimeoutexpires (All messages should be acknowledged expected:<0> but was:<10000>).Fix
broker.setAdvisorySupport(false)inCommonJms.startBroker().CommonJms.createConnectionFactoryWithLocalReceiveNoWait()appendingjms.receiveNoWaitLocalOnly=trueforamqp://URLs and use it inJmsIOITfor non-CLIENT_ACKNOWLEDGEmodes (leavingCommonJms.createConnectionFactory()unchanged forJmsIOTest's direct synchronousreader.start()tests).Verification
./gradlew :sdks:java:io:jms:spotlessCheck :sdks:java:io:jms:checkstyleTest :sdks:java:io:jms:test --rerun :sdks:java:io:jms:integrationTest --rerunlocally:spotlessCheck&checkstyleTest: PASS:sdks:java:io:jms:test: 83/83 passed:sdks:java:io:jms:integrationTest: 6/6 passedRecent Occurrences
3 failing
masterworkflow runs in the past 3 weeks:PreCommit Java Jms IO Direct(3 runs):