Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't check connection state in Locker#assert! #78

Merged
merged 1 commit into from

2 participants

@eric
Owner

Rely on the call to zk.exists? to check that.

I've noticed that the threaded connection has a :retry_duration which would allow for temporary disconnections to be recovered from, but this check to zk.connected? prevents that from working.

This way, we can let the call to zk.exists? do the job of checking if we're connected, and it will place nice with reconnection.

@eric eric Don't check connection state in Locker#assert!
Rely on the call to zk.exists? to check that
d4bcfa6
@slyphon
Owner

seems plausible.

@eric eric merged commit 34fb905 into master

1 check passed

Details default The Travis CI build passed
@eric eric deleted the dont-check-connection-state-in-lock-assert branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2014
  1. @eric

    Don't check connection state in Locker#assert!

    eric authored
    Rely on the call to zk.exists? to check that
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 1 deletion.
  1. +0 −1  lib/zk/locker/locker_base.rb
View
1  lib/zk/locker/locker_base.rb
@@ -277,7 +277,6 @@ def wait_until_blocked(timeout=nil)
def assert!
@mutex.synchronize do
raise LockAssertionFailedError, "have not obtained the lock yet" unless locked?
- raise LockAssertionFailedError, "not connected" unless zk.connected?
raise LockAssertionFailedError, "lock_path was #{lock_path.inspect}" unless lock_path
raise LockAssertionFailedError, "the lock path #{lock_path} did not exist!" unless zk.exists?(lock_path)
raise LockAssertionFailedError, "the parent node was replaced!" unless root_lock_path_same?
Something went wrong with that request. Please try again.