curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordan Zimmerman (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CURATOR-75) InterProcessSemaphoreV2 does not register changes to SharedCountReader while blocking
Date Mon, 03 Feb 2014 21:17:06 GMT

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

Jordan Zimmerman resolved CURATOR-75.
-------------------------------------

    Resolution: Fixed

patch accepted, merged and pushed. Thank you.

> 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)

Mime
View raw message