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

ASF GitHub Bot commented on CURATOR-376:
----------------------------------------

GitHub user ayanamist opened a pull request:

    https://github.com/apache/curator/pull/187

    [CURATOR-376] InterProcessSemaphoreMutex is not thread safe

    Set this.lease to null before lease.close.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ayanamist/curator CURATOR-376

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/187.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #187
    
----
commit 52c9c7d6fecb8df5eb93f0f5a28a2cf3f6268091
Author: ayanamist <[email protected]>
Date:   2017-01-06T07:14:53Z

    fix CURATOR-376
    
    Set this.lease to null before lease.close.

----


> InterProcessSemaphoreMutex is not thread safe
> ---------------------------------------------
>
>                 Key: CURATOR-376
>                 URL: https://issues.apache.org/jira/browse/CURATOR-376
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 3.2.1, 2.11.1
>            Reporter: ayanamist
>
> In `release` method, `lease.close()` will cause `semaphore.acquire` return, 
> then two threads will write on same `this.lease` (one set it to 
> `acquiredLease` while the other set it to `null`), so `acquire` method will 
> return true and `this.lease` is still null, which can't be `release`.



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

Reply via email to