You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Anthony Baker (JIRA)" <ji...@apache.org> on 2016/01/15 07:14:58 UTC

[jira] [Closed] (GEODE-678) DistributedLockService: reentrant lock calls with a small wait time can cause the lock to be lost

     [ https://issues.apache.org/jira/browse/GEODE-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Baker closed GEODE-678.
-------------------------------

> DistributedLockService: reentrant lock calls with a small wait time can cause the lock to be lost
> -------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-678
>                 URL: https://issues.apache.org/jira/browse/GEODE-678
>             Project: Geode
>          Issue Type: Bug
>          Components: core
>            Reporter: Darrel Schneider
>            Assignee: Darrel Schneider
>             Fix For: 1.0.0-incubating.M1
>
>
> If a thread already holds a lock from the DistributedLockService (this also applies to global regions and using Region.getDistributedLock) then it can reenter the lock by acquiring it again by calling lock. Since the thread already holds the lock it does not need to wait to acquire it. But if a very small waitTIme parameter is passed then the implementation may timeout the reacquire call telling the caller that it could not acquire the lock.
> In this case the thread also loses the original lock it held and future attempts to release it will fail with LockNotHeldException.
> The waitTime should only be considered in the initial lock request when you might be waiting for some other thread to release the lock. If you already hold the lock then waitTime should be ignored.



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