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

Memory leak with FailoverTransport when sending TX messages from MDB

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      We observe memory leak in FailoverTransport.stateTracker.connectionStates.transactions when using XA Transactions in activemq-rar, sending message within same transaction and not using useInboundSession.

      In such constellation there are two connections enlisted within same transaction. During commit the transaction manager will execute commit on one of the resources, per JTA 1.2 section 3.3.1 ("(TransactionManager) ensures that the same resource manager only receives one set of prepare-commit calls for completing the target global transaction ".) TransactionContext will propagate the afterCommit to all contexts participating in same transaction. However, this is not enough for ConnectionStateTracker, which only reacts to TransactionInfo command. In effect, when two connection are enlisted in same transaction, just commands of one of them is cleared upon commit, leading to memory leak.

      Since I presume the TransactionInfo should be sent only once for commit of single transaction, ConnectionStateTracker needs to clear state for the acknowledged transactions regardless of connection id in the transaction command.

      Attachments

        1. 0001-AMQ-6391-test.patch
          9 kB
          Patrik Dudits

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pdudits Patrik Dudits
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m