Reconnecting to ZooKeeper works nicely, but it is quite "loud" in the logs.
There are uncaught exceptions propagated when ZooKeeper is not reachable.
Task exception was never retrieved
{'future': <Task finished name='Task-440' coro=<ZooKeeperContainer._readvertise() done, defined at /usr/local/lib/python3.11/dist-packages/asab/zookeeper/container.py:163> exception=SessionExpiredError()>}
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/asab/zookeeper/container.py", line 165, in _readvertise
await adv._readvertise(self)
File "/usr/local/lib/python3.11/dist-packages/asab/zookeeper/container.py", line 231, in _readvertise
await zoocontainer.ZooKeeper.ProactorService.execute(check_at_zk)
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/asab/zookeeper/container.py", line 225, in check_at_zk
if zoocontainer.ZooKeeper.Client.exists(self.RealPath):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/kazoo/client.py", line 1123, in exists
return self.exists_async(path, watch=watch).get()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/kazoo/handlers/utils.py", line 86, in get
raise self._exception
kazoo.exceptions.SessionExpiredError
This is a first step, addressing "Task exception was never retrieved".
The actual handling of the exception must be done in asab.zookeeper.container._readvertise() method.
Reconnecting to ZooKeeper works nicely, but it is quite "loud" in the logs. There are uncaught exceptions propagated when ZooKeeper is not reachable.