Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A good workaround for this is to have a deletion queue/thread. Nodes that need deleting are added to the queue. If a KeeperException is thrown during delete, the node is added back to the queue for eventual deletion.

Implement a retry mechanism

As the ZooKeeper docs make clear, there are a number of "recoverable" exceptions that clients must deal with. In particular, ConnectionLossException and SessionExpiredException. Good ZooKeeper client applications are designed to account for failure. Your ZooKeeper ensemble will experience connection problems in production. Therefore, so should your recipes. A retry mechanism that catches ConnectionLossException, etc. and retries operations as appropriate is highly advised.