You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Jordan Zimmerman (JIRA)" <ji...@apache.org> on 2014/02/03 22:15:07 UTC

[jira] [Assigned] (CURATOR-75) InterProcessSemaphoreV2 does not register changes to SharedCountReader while blocking

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

Jordan Zimmerman reassigned CURATOR-75:
---------------------------------------

    Assignee: Jordan Zimmerman

> InterProcessSemaphoreV2 does not register changes to SharedCountReader while blocking
> -------------------------------------------------------------------------------------
>
>                 Key: CURATOR-75
>                 URL: https://issues.apache.org/jira/browse/CURATOR-75
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 2.3.0
>            Reporter: Joshua Bandur
>            Assignee: Jordan Zimmerman
>             Fix For: 2.4.0
>
>         Attachments: CURATOR-75.patch
>
>
> When using InterProcessSemaphoreV2 with a SharedCountReader:
> If the call to acquire() is currently blocking because no leases are available, and you increase the value that the SharedCountReader is tracking, acquire() does not notice the change, and continues to block until timeout. The expected behavior would be for it to notice the new value right away, completing the call successfully if there is now a sufficient number of leases available, or continuing to block if there still aren't enough.
> I suspect the problem is in the SharedCountListener:
>             count.addListener
>                 (
>                     new SharedCountListener()
>                     {
>                         @Override
>                         public void countHasChanged(SharedCountReader sharedCount, int newCount) throws Exception
>                         {
>                             InterProcessSemaphoreV2.this.maxLeases = newCount;
>                         }
>                         ...
>                     }
>                 );
> This event handler should probably call InterProcessSemaphoreV2.this.notifyAll() to wake any threads blocked in internalAcquire1Lease().



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)