You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2016/01/25 16:14:39 UTC

[jira] [Commented] (OAK-3833) Allow to acquire multiple locks

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

Marcel Reutegger commented on OAK-3833:
---------------------------------------

Thanks for the patch. {{StripedNodeDocumentLocks}} looks fine, though I would initiallize {{ROOT}} with {{Utils.getIdFromPath("/")}}. I'm not so sure about {{TreeNodeDocumentLocks}}. There are two {{bulkGet()}} calls, one for the parent keys and one for the keys passed to {{acquire(Collection<String>)}}. In a next step, {{TreeLock.shared()}} is called in the sequence of the passed keys together with the parent key lock with the same index. Doesn't this create {{TreeLock}}s with a combination of parentKey and key that do not actually exist and result in a sequence that may deadlock?

> Allow to acquire multiple locks
> -------------------------------
>
>                 Key: OAK-3833
>                 URL: https://issues.apache.org/jira/browse/OAK-3833
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: documentmk
>            Reporter: Tomek Rękawek
>             Fix For: 1.4
>
>         Attachments: OAK-3833.patch
>
>
> The {{NodeDocumentLocks}} type should be extended with a new method that allows to acquire multiple locks. Locks should be always ordered in the same way to avoid deadlocks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)