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

Incorrect handling of interruptions during commit or rollback of a transaction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.3.0
    • 5.13.0
    • None
    • None
    • Java 1.6.0_02
      Kubuntu Linux 2.6.24-22
      Bitronix Transaction Manager 1.3.2

    • Patch Available

    Description

      We have a process framework that sends interruptions to threads that should be stopped or paused. Some of these threads interact with ActiveMQ, so interruptions can occur inside ActiveMQ at different points.
      A problem occurs if the interruption is detected in ActiveMQConnection.syncSendPacket during commit or rollback of a transaction. ActiveMQ then throws a JMSException so that it appears to Bitronix as if the XA transaction is in an inconsistent state (see stacktrace in the attached file).

      In our opinion, the interruption should be ignored by ActiveMQ during the critical commit or rollback phase. It is not mandatory that an interruption has an immediate effect. Especially such a non-interruptable step as rollback or commit should be performed even though an interruption occurs.

      I created a patch for the class TransactionContext which, in case of an interruption, resets the interruption state of the thread, retries the syncSendPacket method call and restores the thread's interruption state afterwards. In this manner, no inconsistent state exceptions occur in the transaction manager any longer and interruption is deferred until the commit/rollback has succeeded.

      Attachments

        1. activemq_interruption_fix.diff
          5 kB
          Michael Gottschalk
        2. ACTIVEMQ-PATCH
          1.0 kB
          Ralf Menzel
        3. xa-jms-exception.txt
          9 kB
          Michael Gottschalk

        Issue Links

          Activity

            People

              gtully Gary Tully
              mgottschalk Michael Gottschalk
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: