Skip to content

Commit

Permalink
Merge pull request #812 from DanielNi/master
Browse files Browse the repository at this point in the history
Zookeeper: Set the correct lock state when releasing because of ZK disconnect
  • Loading branch information
ChandraAddala committed Jun 1, 2017
2 parents 358242e + ba75bb3 commit 6064bfc
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -627,7 +627,7 @@ boolean canWork() {
* Triggered during the connection loss. Release the lease, and clear the mutex.
*/
void connectionLost() {
release(false);
release(true);
}

synchronized void setState(LockState newState) {
Expand Down Expand Up @@ -737,7 +737,7 @@ public Boolean call() throws Exception {
return false;
} finally {
lockTaskCount.decrementAndGet();
if (!disconnected) {
if (disconnected) {
setState(LockState.ERROR);
} else {
setState(LockState.DISINTERESTED);
Expand Down

0 comments on commit 6064bfc

Please sign in to comment.