You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/03/08 08:40:01 UTC

[jira] [Work logged] (AMQ-6391) Memory leak with FailoverTransport when sending TX messages from MDB

     [ https://issues.apache.org/jira/browse/AMQ-6391?focusedWorklogId=562210&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-562210 ]

ASF GitHub Bot logged work on AMQ-6391:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Mar/21 08:39
            Start Date: 08/Mar/21 08:39
    Worklog Time Spent: 10m 
      Work Description: lucastetreault commented on pull request #197:
URL: https://github.com/apache/activemq/pull/197#issuecomment-792580640


   Can one of the admins verify this patch?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 562210)
    Remaining Estimate: 0h
            Time Spent: 10m

> Memory leak with FailoverTransport when sending TX messages from MDB
> --------------------------------------------------------------------
>
>                 Key: AMQ-6391
>                 URL: https://issues.apache.org/jira/browse/AMQ-6391
>             Project: ActiveMQ
>          Issue Type: Bug
>            Reporter: Patrik Dudits
>            Priority: Major
>         Attachments: 0001-AMQ-6391-test.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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|https://github.com/apache/activemq/blob/a65f5e7c2077e048a2664339f6425d73948d71ce/activemq-client/src/main/java/org/apache/activemq/TransactionContext.java#L478] will propagate the afterCommit to all contexts participating in same transaction. However, this is not enough for {{ConnectionStateTracker}}, which only reacts to [TransactionInfo command|https://github.com/apache/activemq/blob/a65f5e7c2077e048a2664339f6425d73948d71ce/activemq-client/src/main/java/org/apache/activemq/TransactionContext.java#L469]. 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)