summaryrefslogtreecommitdiff
path: root/kazoo/recipe
Commit message (Collapse)AuthorAgeFilesLines
* feat: pep8 all the thingsfeat/issue-445Ben Bangert2017-06-013-30/+46
| | | | | | Brings the code-base back up to validating flake8 checks. Closes #445
* Revert "New recipe proposal: TreeCache"Ben Bangert2017-05-311-389/+0
|
* Merge pull request #430 from anskornyakov/hotfix/semaphore-deadlockBen Bangert2017-05-311-3/+3
|\ | | | | fix deadlock in nonblocking semaphore acquiring
| * fix deadlock in nonblocking semaphore acquiring, do inner lock release for ↵Anton Skornyakov2017-04-201-3/+3
| | | | | | | | every lock acquiring attempt
* | Merge pull request #398 from tonyseek/feature/treecache-recipeBen Bangert2017-05-311-0/+389
|\ \ | | | | | | New recipe proposal: TreeCache
| * | Fix the infinite refresh after root node deletedqifei.wan2017-04-241-3/+3
| | |
| * | Closed tree cache could not be started againJiangge Zhang2017-04-171-0/+5
| | |
| * | Rename "was_xxx" to "on_xxx" in TreeCacheJiangge Zhang2017-02-251-14/+14
| | | | | | | | | | | | https://github.com/python-zk/kazoo/pull/398#discussion_r90782660
| * | Use KazooException instead of RuntimeError in TreeCacheJiangge Zhang2017-02-251-2/+2
| | | | | | | | | | | | https://github.com/python-zk/kazoo/pull/398#discussion_r90782555
| * | Add default logger if no listener is present.Jiangge Zhang2016-12-051-7/+9
| | |
| * | Implement and test the TreeCache recipe.Jiangge Zhang2016-06-231-0/+382
| | |
* | | Merge pull request #397 from paperlessreceipts/counter-pre-post-valuesBen Bangert2017-05-311-2/+11
|\ \ \ | | | | | | | | Counter: expose the previous and changed values.
| * | | Counter: expose the previous and changed values.Lukasz Kawczynski2016-06-101-2/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #391 from michielbaird/watcher_changesBen Bangert2017-05-311-1/+2
|\ \ \ | | | | | | | | Ensure pending watches are not dropped when connection is lost
| * | | Added test add fixed a regressionMichiel Johan Baird2016-04-201-1/+2
| |/ /
* | | Merge pull request #359 from rockerbox/queue-patchBen Bangert2017-05-311-7/+3
|\ \ \ | | | | | | | | Fixed Queue to clear children before retry
| * | | made recipe.queue clear children on retrypatrickotoole2015-09-181-7/+3
| | | |
* | | | Merge pull request #354 from d3matt/FIX/potential_leakBen Bangert2017-05-311-0/+2
|\ \ \ \ | | | | | | | | | | Fix potential leak in DataWatch and ChildrenWatch
| * | | | Fix potential leak in DataWatch and ChildrenWatchMatthew Stoltenberg2015-08-191-0/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #419 from jeblair/shared-locksBen Bangert2017-05-311-8/+93
|\ \ \ \ | | | | | | | | | | Implement read-write (shared) lock from ZooKeeper recipe
| * | | | Set watch on immediate predecessor in locksJames E. Blair2017-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 typo in ReadLock exampleJames E. Blair2017-03-111-1/+1
| | | | |
| * | | | Fix typosJames E. Blair2017-03-101-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Fix typos introduced in the conversion to classes, and also re-adopt the extant naming convention for the class variables.
| * | | | Convert read/write locks into classesJames E. Blair2017-03-101-47/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Fix typo.Catalin Patulea2017-03-101-1/+1
| | | | |
| * | | | Improve documentation for node name parsing.Catalin Patulea2017-03-101-1/+8
| | | | |
| * | | | Improve documentation, make more pythonic.Catalin Patulea2017-03-101-5/+10
| | | | |
| * | | | Fix lease, which creates nodes other than __lock__ under the lock path.Catalin Patulea2017-03-101-1/+2
| | | | |
| * | | | Implement read-write (shared) lock from ZooKeeper recipe.Catalin Patulea2017-03-101-10/+83
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #302 from bartekrutkowski/masterBen Bangert2017-05-311-0/+18
|\ \ \ \ | |/ / / |/| | | Add LockingQueue.release() method
| * | | Add LockingQueue.release() methodBartek Rutkowski2014-06-271-0/+18
| | | |
* | | | Close the ChildrenWatch if the node doesn't exist.Jiangge Zhang2016-06-211-2/+7
| |_|/ |/| | | | | | | | | | | | | | This implementation resolves the "NoNodeError" while watching children. Fix #149.
* | | Merge pull request #358 from kormat/lock_failuresJoshua Harlow2016-02-251-4/+4
|\ \ \ | | | | | | | | Fix handling of retry failures in Lock.acquire
| * | | Fix handling of retry failures in Lock.acquireStephen Shirley2015-09-101-4/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | (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 examples in recipesŁukasz Jernaś2015-08-055-0/+5
|/ / | | | | | | | | Fix the recipe examples, so they actually work by connecting to ZooKeeper. Without start() they just hang and can't be killed.
* | Merge pull request #322 from harlowja/better-cleanupBen Bangert2015-05-281-1/+0
|\ \ | | | | | | Do cleanup in a more more robust manner
| * | Do cleanup in a more more robust mannerJoshua Harlow2015-05-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | Use a mini-watch helper to ensure timeout is decreasedJoshua Harlow2015-05-271-2/+24
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Fix semaphore usageJoshua Harlow2015-05-271-4/+7
|/ / | | | | | | | | | | | | | | | | | | 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).
* | Stop retrying when already acquired and non-blockingJoshua Harlow2015-05-111-0/+2
| | | | | | | | Fixes issue #315
* | Merge pull request #297 from harlowja/match-threading-lockBen Bangert2015-04-171-20/+53
|\ \ | | | | | | Have the lock reentrancy behave like threading.lock
| * | Fix bad syntax errorJoshua Harlow2015-03-191-1/+1
| | |
| * | Have mini-lock routine return true resultJoshua Harlow2015-03-191-1/+2
| | |
| * | Have the lock reentrancy behave like threading.lockJoshua Harlow2015-03-191-20/+52
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Add lease recipe.Lars Albertsson2015-03-211-0/+130
|/ /
* | Merge pull request #283 from KonishchevDmitry/pr-fix-race-in-partitionerBen Bangert2015-03-171-28/+77
|\ \ | | | | | | Fix a race condition in SetPartitioner when party changes during handling of lock acquisition
| * | Fix a race condition when party changes during lock acquisitionDmitry Konishchev2015-02-201-28/+77
| | |
| * | Always call self._allocate_transition() asynchronously to not block Gevent ↵Dmitry Konishchev2015-02-201-1/+1
| | | | | | | | | | | | hub with locks
* | | Merge pull request #294 from harlowja/no-re-entrant-commentBen Bangert2015-03-171-0/+2
|\ \ \ | | | | | | | | Add comment to sempahore recipe noting its not re-entrant
| * | | Don't forget the 'be'Joshua Harlow2015-03-171-1/+1
| | | |