Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(recipe): conn hangs when TreeCache refreshing
The previous implementation of session watcher triggers blocked operations. If there is a huge tree in ZooKeeper, reconnecting event will lead an initialized TreeCache into a bad performance state, because the connection routine was blocked by the session watcher of TreeCache. This commit put those blocked operations into a background queue to fix this. There is an example code snippet: from kazoo.client import KazooClient from kazoo.recipe.cache import TreeCache client = KazooClient() client.start() cache = TreeCache(client, '/a-huge-tree') cache.start() # Wait the cache be initialized and trigger a connection lost event. client.get_children('/') # The connection is still broken The patch of this commit has been used in the production environment of https://github.com/eleme.
- Loading branch information