curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Bandur (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CURATOR-75) InterProcessSemaphoreV2 does not register changes to SharedCountReader while blocking
Date Thu, 21 Nov 2013 17:40:36 GMT

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

Joshua Bandur updated CURATOR-75:
---------------------------------

    Attachment: CURATOR-75.patch

Patch includes fix to InterProcessSemaphoreV2 and modification of testThreadedLeaseIncrease()
that demonstrates the problem.

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

Mime
View raw message