-
Bug
-
Resolution: Done
-
Blocker
-
5.1.0.BETA4
-
None
The following configuration leaks remote transactions:
<?xml version="1.0" encoding="UTF-8"?> <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:5.1"> <global> <transport clusterName="x"> <properties> <property name="configurationFile" value="jgroups-tcp.xml"/> </properties> </transport> </global> <default> <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC"/> <locking concurrencyLevel="1000" useLockStriping="false" /> <clustering mode="r"> <sync replTimeout="10000"/> <stateRetrieval fetchInMemoryState="false"/> </clustering> </default> </infinispan>
Why? The transaction completion notification is not being sent around, so remote transactions keep piling up. The code is in AbstractEnlistmentAdapter:
private void removeTransactionInfoRemotely(LocalTransaction localTransaction, GlobalTransaction gtx) { if (isClustered() && !config.isSecondPhaseAsync()) { final TxCompletionNotificationCommand command = commandsFactory.buildTxCompletionNotificationCommand(null, gtx); final Collection<Address> owners = clusteringLogic.getOwners(localTransaction.getAffectedKeys()); log.tracef("About to invoke tx completion notification on nodes %s", owners); rpcManager.invokeRemotely(owners, command, false); } }
Taking in account that the invokeRemotely is called with sync=False, looks to me the if condition should be:
if (isClustered() && config.isSecondPhaseAsync())
Otherwise, if the condition is right as it is, who should be responsible of removing remote transactions? It's definitely not responsibility of StaleTransactionCleanupService who should only do its job if nodes have left the cluster, not under normal conditions.
Just tried my suggested fix and seems to improve things although some remote transactions (a handful out of 250) are still not finished when the caches are shutdown.