[infinispan-issues] [JBoss JIRA] (ISPN-2913) putForExternalRead leaves locks

Sebastian Tusk (JIRA) jira-events at lists.jboss.org
Thu Mar 28 05:03:41 EDT 2013


    [ https://issues.jboss.org/browse/ISPN-2913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763689#comment-12763689 ] 

Sebastian Tusk commented on ISPN-2913:
--------------------------------------

My understanding is that putForExternalRead is not transactional. See ISPN-1615. At least I can not observe anything that looks like a transaction when using putForExternalRead. My fix <https://github.com/infinispan/infinispan/pull/1737/files> is to unlock if not in a transaction. And the condition (!ctx.isInTxScope()) can be true. So I guess there are ways to have PutKeyValueCommand outside of transactions.

I do not see anything in 5.2.5.Final that looks like it could affect this problem. But I will test this version next week.
                
> putForExternalRead leaves locks
> -------------------------------
>
>                 Key: ISPN-2913
>                 URL: https://issues.jboss.org/browse/ISPN-2913
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Locking and Concurrency
>    Affects Versions: 5.2.1.Final
>            Reporter: Sebastian Tusk
>            Assignee: Mircea Markus
>            Priority: Critical
>
> In TxDistributionInterceptor.remoteGetAndStoreInL1 locks are acquired. Without a transaction these locks are never released. The cache setup is Dist, Async, L1, 2 Nodes, 1 Owner, Optimistic Locking.
> In AbstractTxLockingInterceptor.visitGetKeyValueCommand locks are released explicitly if outside of transactions. I fixed this problem by doing the same in OptimisticLockingInterceptor.visitPutKeyValueCommand. It is very likely that this doesn't fix all problems. For instance OptimisticLockingInterceptor.visitPutMapCommand or PessimisticLockingInterceptor.
> Cache Config:
> 	<namedCache name="entity">
> 		<jmxStatistics enabled="true" />
> 		
> 		<clustering mode="dist">
> 			<stateTransfer fetchInMemoryState="false" timeout="20000" />
> 			<async />
> 			<l1 enabled="true" />
> 			<hash numOwners="1"/>
> 		</clustering>
> 		<locking isolationLevel="READ_COMMITTED"
> 			lockAcquisitionTimeout="15000" useLockStriping="false" />
> 			
> 		<eviction maxEntries="10000" strategy="LRU" />
> 		<expiration maxIdle="100000" wakeUpInterval="5000"/>
> 		<storeAsBinary storeKeysAsBinary="true" storeValuesAsBinary="false" enabled="false" />
> 		
> 		<transaction transactionMode="TRANSACTIONAL" autoCommit="false" lockingMode="OPTIMISTIC"/>
> 	</namedCache>
> Fixed OptimisticLockingInterceptor.visitPutKeyValueCommand:
>    @Override
>    public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable {
>       try {
>          if (command.isConditional()) markKeyAsRead(ctx, command);
>          return invokeNextInterceptor(ctx, command);
>       } catch (Throwable te) {
>          throw cleanLocksAndRethrow(ctx, te);
>       } finally {
>          //with putForExternalRead the value might be put into L1 without a transaction
>          //we need to release any locks for these cases
>          if (!ctx.isInTxScope()) lockManager.unlockAll(ctx);
>       }
>    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list