curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Drob (JIRA)" <>
Subject [jira] [Commented] (CURATOR-205) Repeated InterruptedExceptions during mutex acquire leads to LeaderSelector deadlock
Date Tue, 12 May 2015 15:37:00 GMT


Mike Drob commented on CURATOR-205:

[~sfingram] - If you can open a pull request on GitHub with unit tests and the fix, that would
be the fastest way of us getting the issue resolved for you. If you don't have the time for
this, then I can try to work on it, but will probably just duplicate whatever you have.

> Repeated InterruptedExceptions during mutex acquire leads to LeaderSelector deadlock
> ------------------------------------------------------------------------------------
>                 Key: CURATOR-205
>                 URL:
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 2.8.0
>            Reporter: Stephen Ingram
> When an InterruptedException is thrown during the internalLockLoop that is called during
mutex.acquire, internalLockLoop will set a flag "doDelete" which signals during a finally
clause to delete the lock path that we are trying to create.
> However, in the pathInForeground function of DeleteBuilderImpl, a _second_ InterruptedException
may occur before zookeeper can delete the specified path.  The RetryLoop machinery contained
in the function will only retry if it is a Retryable Exception, an equivalence class which
does not include InterruptedExceptions.  
> The second InterruptedException exception then causes an exit of the pathInForeground
function without deleting the path, leading to a deadlock where no one can acquire the mutex.
> In my test, I am certain that both of these InterruptedExceptions are due to repeated
fluctuation in the ConnectionStateManager's connection state.  When the state ceases to fluctuate,
no leader can be selected due to the persistence of the node we failed to delete.
> I was able to address this bug with a solution similar to CURATOR-45:  if the pathInForeground
function is interrupted with an InterruptedException, I schedule a BackgroundCallback to attempt
pathInForeground again.  This task is able to delete the path when the connection is stable
and the mutex is acquired by the new leader.
> I have a repro and a fix if needed.

This message was sent by Atlassian JIRA

View raw message