Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-4073

Cannot shut down broker under certain conditions with schedule delivery and producer flow control

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.6.0
    • 5.9.0
    • Broker
    • None

    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

        Issue Links

          Activity

            People

              tabish Timothy A. Bish
              davaleri David Valeri
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: