nodepool/nodepool/zk
James E. Blair 619dee016c Continuously ensure the component registry is up to date
On startup, the launcher waits up to 5 seconds until it has seen
its own registry entry because it uses the registry to decide if
other components are able to handle a request, and if not, fail
the request.

In the case of a ZK disconnection, we will lose all information
about registered components as well as the tree caches.  Upon
reconnection, we will repopulate the tree caches and re-register
our component.

If the tree cache repopulation happens first, our component
registration may be in line behind several thousand ZK events.  It
may take more than 5 seconds to repopulate and it would be better
for the launcher to wait until the component registry is up to date
before it resumes processing.

To fix this, instead of only waiting on the initial registration,
we check each time through the launcher's main loop that the registry
is up-to-date before we start processing.  This should include
disconnections because we expect the main loop to abort with an
error and restart in those cases.

This operates only on local cached data, so it doesn't generate any
extra ZK traffic.

Change-Id: I1949ec56610fe810d9e088b00666053f2cc37a9a
2024-03-04 14:28:11 -08:00
..
vendor Vendor persistent recursive watch Kazoo support 2023-04-10 15:57:01 -07:00
__init__.py Vendor persistent recursive watch Kazoo support 2023-04-10 15:57:01 -07:00
components.py Continuously ensure the component registry is up to date 2024-03-04 14:28:11 -08:00
exceptions.py Use Zuul-style ZooKeeper connections 2022-05-23 07:40:20 -07:00
handler.py Use Zuul-style ZooKeeper connections 2022-05-23 07:40:20 -07:00
zookeeper.py Merge "Always complete cache init on reconnect" 2023-08-14 21:22:34 +00:00