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

Deadlock in AMQMessageStore when using transactions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 5.1.0
    • 5.2.0
    • Broker
    • None
    • Red Hat Enterprise Linux ES release 4 (Nahant Update 3)
      jdk1.6.0_07

    Description

      I am using ActiveMQ 5.1.0 with the AMQMessageStore (in the default configuration except data directory location) and sending/receiving transactionally using the VMTransport. This produced the deadlock shown in the attached (partial) thread dump, generated by jstack -l.

      In a nutshell, the VMTransport thread is holding the AMQMessageStore.lock=KahaReferenceStore.lock, acquired at AMQMessageStore.java:231, while awaiting a countDown on AMQMessageStore.flushLatch. The ActiveMQ Task (which is the AMQMessageStore.asyncWriteTask) should do the countDown on the flushLatch but is waiting on acquiring the KahaReferenceStore.lock first. Hence deadlock.

      Note that the condition messageAcks.size() > this.peristenceAdapter.getMaxCheckpointMessageAddSize() must be true for the deadlock to occur – this triggers the flush.

      Since the transport is one of the deadlocked threads, all access via the transport stops, making the broker unusable and making this issue a blocker for me. A comment (workaround?) as soon as possible would be much appreciated.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--thread_dump.txt
          5 kB
          J Moran
        2. AMQ-1856.patch
          0.8 kB
          J Moran

        Activity

          People

            rajdavies Robert Davies
            jmoran J Moran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: