[infinispan-issues] [JBoss JIRA] (ISPN-5654) Make DeadlockDetectingLockManager aware of single-node locking

Dan Berindei (JIRA) issues at jboss.org
Tue Feb 28 08:47:00 EST 2017


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

Dan Berindei edited comment on ISPN-5654 at 2/28/17 8:46 AM:
-------------------------------------------------------------

-Looking at the code, the deadlock detection doesn't seem to work at all in most cases. Lock intentions are only added in {{DeadlockDetectingLockManager.lock(key)}}, which doesn't get called on the transaction originator unless it's also the primary owner of the key. Thus lock intentions are never sent from the tx originator to the primary owners, and deadlock detection for multiple keys only works when all the keys are owned by the originator.- And of course, same-key deadlocks cannot happen at all with the single-node locking.

-I propose to remove {{DeadlockDetectingLockManager}} altogether and to deprecate the related configuration.-

-Update: I had missed {{DeadlockDetectingInterceptor}}, which does add remote lock intentions on the originator for all the locked keys. So deadlock detection should work, both with pessimistic locking and with optimistic locking, although the number of deadlocks should be much smaller with single-node locking.-



was (Author: dan.berindei):
-Looking at the code, the deadlock detection doesn't seem to work at all in most cases. Lock intentions are only added in {{DeadlockDetectingLockManager.lock(key)}}, which doesn't get called on the transaction originator unless it's also the primary owner of the key. Thus lock intentions are never sent from the tx originator to the primary owners, and deadlock detection for multiple keys only works when all the keys are owned by the originator.- And of course, same-key deadlocks cannot happen at all with the single-node locking.

-I propose to remove {{DeadlockDetectingLockManager}} altogether and to deprecate the related configuration.-

Update: I had missed {{DeadlockDetectingInterceptor}}, which does add remote lock intentions on the originator for all the locked keys. So deadlock detection should work, both with pessimistic locking and with optimistic locking, although the number of deadlocks should be much smaller with single-node locking.

> Make DeadlockDetectingLockManager aware of single-node locking
> --------------------------------------------------------------
>
>                 Key: ISPN-5654
>                 URL: https://issues.jboss.org/browse/ISPN-5654
>             Project: Infinispan
>          Issue Type: Task
>          Components: Core
>    Affects Versions: 8.0.0.Beta2
>            Reporter: Dan Berindei
>
> {{DeadlockDetectingLockManager}} seems to assume that the node that started a transaction acquires a local lock before replicating, which is wrong since we switched to locking only on the primary owner.
> In particular, {{isSameKeyDeadlock}} can probably be removed altogether.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the infinispan-issues mailing list