Repository navigation
Conversation
…rk is rejected Saturates the thread pool of the ActiveMQ resource adapter so that scheduling the ServerSession work fails, then checks the MDB consumes again once the pool recovers. It does not, see the 'MDB pool drops instances on RejectedExecutionException' thread on dev@.
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.
Reproducer for the "MDB pool drops instances on RejectedExecutionException" thread on dev@. Not meant to be merged as is. The test fails on purpose.
What the test does
The ActiveMQ resource adapter gets
threadPoolSize=2,QueueSize=1andOfferTimeout=1 second.maxSessions=1. Scheduling itsServerSessionwork is rejected after the offer timeout.maxSessions=1MDB. It is never consumed.With
-DofferTimeout="30 seconds"the work only waits and is never rejected, and the test passes. The rejection is what kills the consumer.Analysis
The code involved is identical in 10.2.0 (activemq-ra 6.2.7, geronimo-connector 4.0.0) and on main (activemq-ra 6.3.2).
GeronimoWorkManager.executeWorkletsRejectedExecutionExceptionescape.ServerSessionImpl.start()only catchesWorkException, sorunningstaystrue. The session stays inactiveSessionswithout a thread and is never considered stale. WithmaxSessions=1the consumer is dead for good; with more sessions a slot leaks per rejection. Nothing is logged.-Dversion.geronimo.components=4.0.1-SNAPSHOT):start()fails with aJMSException, which reaches the exception listener ofActiveMQEndpointWorker. The listener disconnects and callsconnect(), which schedules the reconnect on the same, still saturated WorkManager. OnWorkExceptionit setsrunning = falseand logs "Work Manager did not accept work", so the endpoint never reconnects. The test fails the same way, with this sequence in the log:Both holes are in activemq-ra (
ServerSessionImpl.start()andActiveMQEndpointWorker.connect()), so the fix most likely belongs upstream.