| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Brings the code-base back up to validating flake8 checks.
Closes #445
|
| |
|
|\
| |
| | |
fix deadlock in nonblocking semaphore acquiring
|
| |
| |
| |
| | |
every lock acquiring attempt
|
|\ \
| | |
| | | |
New recipe proposal: TreeCache
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
https://github.com/python-zk/kazoo/pull/398#discussion_r90782660
|
| | |
| | |
| | |
| | | |
https://github.com/python-zk/kazoo/pull/398#discussion_r90782555
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Counter: expose the previous and changed values.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit extends the `Counter` API with the `pre_value` and
`post_value` attributes. These attributes are set when a counter
is changed. Previously, if the counter was modified concurrently,
it was not possible to access the exact value to which the counter
was set after a successful increment or decrement.
|
|\ \ \
| | | |
| | | | |
Ensure pending watches are not dropped when connection is lost
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
Fixed Queue to clear children before retry
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix potential leak in DataWatch and ChildrenWatch
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
If the func passed to DataWatcher or ChildrenWatch is bound to an object it
will keep a reference to the object around which could prevent it from getting
garbage collected.
|
|\ \ \ \
| | | | |
| | | | | |
Implement read-write (shared) lock from ZooKeeper recipe
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The original lock code would set the watch on the last node which
preceded our node. This is efficient because if there are N
predecessors, then we would only set the watch on the latest and
would therefore only wake up and go through the loop after all
the predecessors had released their locks. The change to support
shared locks, however, set the watch on the first node which
preceded ours, meaning that we will wake up and iterate through
the loop for all N predecessor nodes.
This patch restores the original behavior where the watch was only
set on the immediate predecessor.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fix typos introduced in the conversion to classes, and also re-adopt
the extant naming convention for the class variables.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Replace the RLock and WLock functions with subclasses of Lock:
ReadLock and WriteLock. Add those to the client class for
convenience. Restore the function signature of the Lock class
initializer. Add tests for shared locks. Add to API docs.
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Reference: http://zookeeper.apache.org/doc/trunk/recipes.html#Shared+Locks
This is a writer-preference shared lock.
Most of the lock protocol is the same as for an exclusive lock, except that it needs to be parameterized on:
1) Node name - lock "kind" - a write lock (__lock__) or read lock (__rlock__).
2) Which node names block which other node names (read locks block only writers, writers block both).
3) Finding the predecessor node according to the rule in #2.
These changes are integrated to the main Lock class. The changes are backward compatible with existing users of Lock. Users should normally never pass the Lock node_name and exclude_names kwargs directly, they should use WLock and RLock.
|
|\ \ \ \
| |/ / /
|/| | | |
Add LockingQueue.release() method
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | |
| | | |
This implementation resolves the "NoNodeError" while watching children.
Fix #149.
|
|\ \ \
| | | |
| | | | |
Fix handling of retry failures in Lock.acquire
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
(Fixes https://github.com/python-zk/kazoo/issues/288)
- Make sure that self.node always exists.
- Use _best_effort_cleanup() instead of _delete_node() when we didn't
get the lock.
- Make RetryFailedError use the existing cleanup code.
- Make _best_effort_cleanup use self.node if it's set, and fall back to
_find_node otherwise.
|
|/ /
| |
| |
| |
| | |
Fix the recipe examples, so they actually work by connecting
to ZooKeeper. Without start() they just hang and can't be killed.
|
|\ \
| | |
| | | |
Do cleanup in a more more robust manner
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Adds checks to make sure that on each stop that
is called that the zookeeper process has exited cleanly with
a zero error code (and log if this doesn't happen)
- Log the started programs
- Track all created clients (and stop them on teardown)
- Track threads made in lock/sempahore tests and clean them up
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After the initial lock is acquired the timeout can now
be different (due to time used getting the lock) so add
a little helper class to ensure that the timeout is
changed due to the elapsed time.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The semaphore should be passing the blocking argument to the
underlying lock that is used (so it is non-blocking as well) and
it should also be passing the timeout as well.
The non-blocking result should also not add a watch that will
later attempt to get the least (another call to acquire should be
used instead, or the blocking mode should be used instead).
|
| |
| |
| |
| | |
Fixes issue #315
|
|\ \
| | |
| | | |
Have the lock reentrancy behave like threading.lock
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of having it raise a runtime error have the calling
thread block until the lock has been released (typically
by some other thread). This more closely matches the existing
and (assumingly) expected behavior of locks.
|
|/ / |
|
|\ \
| | |
| | | |
Fix a race condition in SetPartitioner when party changes during handling of lock acquisition
|
| | | |
|
| | |
| | |
| | |
| | | |
hub with locks
|
|\ \ \
| | | |
| | | | |
Add comment to sempahore recipe noting its not re-entrant
|
| | | | |
|