curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordan Zimmerman (JIRA)" <>
Subject [jira] [Commented] (CURATOR-283) LockInternals does not deal with spurious weakup?
Date Wed, 23 Dec 2015 13:41:46 GMT


Jordan Zimmerman commented on CURATOR-283:

Is this an issue you are seeing in production or a hypothetical possibility from your reading
of the code? If the latter, again, the email lists should be used to discuss.

Synchronized does not help for the code in question as this code is trying to coordinate DIFFERENT
JVMs. The code outside of the synchronized block is making a ZooKeeper call to get the list
of children in the parent lock node. Synchronizing this adds nothing. The important part of
the code is the client.getData() call. If the ZNode exists a watcher will be established.
If the node does not exist the loop is tried again. This is correct. 

> LockInternals does not deal with spurious weakup?
> -------------------------------------------------
>                 Key: CURATOR-283
>                 URL:
>             Project: Apache Curator
>          Issue Type: Test
>          Components: Recipes
>            Reporter: csulyj
>            Priority: Trivial
> I don't understand why method internalLockLoop doesn't not deal with spurious weakup?
> I think it should be like this : 
>  synchronized (obj) {
>      while (condition does not hold)
>         obj.wait(timeout);
>          ... // Perform action appropriate to condition
>  }

This message was sent by Atlassian JIRA

View raw message