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

Jonathan S Fisher edited comment on AMQ-6391 at 9/12/19 1:18 PM:
-----------------------------------------------------------------

Say you have a network of brokers and you restart the one your container is 
connected to.

We _do_ want it to reconnect on a connection failure, AND we're willing to have 
an error thrown in any "in-flight" (non completed) transaction. We would hope 
that any open JMSSessions/Listeners would be routed through to the new broker 
after reconnect without issue.

Does this
{code:java}
stateTracker.setTrackTransactions(false);{code}
accomplish this end? We tried it out and it seems to work but I just want to 
make sure I understand all the side effects :)

Our URL is:
{code:java}
ACTIVEMQ_URL=failover:(ssl://activemq-1.example.com:61616?keepAlive=true,ssl://activemq-3.example.com:61616?keepAlive=true)?randomize=false{code}


was (Author: exabrial):
Say you have a network of brokers and you restart the one your container is 
connected to.

We _do_ want it to reconnect on a connection failure, but we're willing to have 
an error thrown in any  "in-flight" (non completed) transaction. We would hope 
that any open JMSSessions/Listeners would be routed through to the new broker 
after reconnect without issue. 

Does this {code}stateTracker.setTrackTransactions(false);{code} accomplish this 
end? We tried it out and it seems to work but I just want to make sure I 
understand all the side effects :)

Our URL is:

{code}ACTIVEMQ_URL=failover:(ssl://activemq-1.example.com:61616?keepAlive=true,ssl://activemq-3.example.com:61616?keepAlive=true)?randomize=false{code}



> 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
>
>
> 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.2#803003)

Reply via email to