Description
When producer flow control is enabled and the the job scheduler attempts delivery, the job scheduler blocks while attempting delivery. This blocking holds the lock on the job scheduler and stops all other job scheduler activity. The holding of the lock on the job scheduler also blocks the delivery of additional scheduled messages and can impact the shutdown of the broker.
org.apache.activemq.broker.scheduler.JobSchedulerImpl.schedule(String, ByteSequence, String, long, long, int) waits for the lock while the job scheduler is blocked. Any transport connections attempting to call this method get blocked and are also unable to shutdown. Connections do log "2012-09-24 12:04:23,661 [main ] - INFO TransportConnection - The connection to 'vm://localhost#0' is taking a long time to shutdown." when attempting shutdown with the job scheduler blocked and a client attempting to schedule a message, but do not log anything when this situation occurs under normal broker operation. The producer simply stops producing messages.
The shutdown is blocked by org.apache.activemq.broker.TransportConnection.serviceLock as it is owned by the blocked thread trying to schedule a new message.
I have attached a unit test that reproduces the issue. The test will not complete as it hangs on the broker shutdown as described above.
Attachments
Attachments
Issue Links
- relates to
-
AMQ-3141 Messages may be lost when schedule them with a short delay
- Resolved