Skip to content

Commit

Permalink
chore: handle NoNodeError during relation-broken (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoppenheimer authored Oct 16, 2024
1 parent b0b9bc0 commit 2589362
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/managers/quorum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
QuorumLeaderNotFoundError,
ZooKeeperManager,
)
from kazoo.exceptions import BadArgumentsError, ConnectionClosedError
from kazoo.exceptions import BadArgumentsError, ConnectionClosedError, NoNodeError
from kazoo.handlers.threading import KazooTimeoutError
from kazoo.security import make_acl
from ops.charm import RelationEvent
Expand Down Expand Up @@ -241,4 +241,8 @@ def update_acls(self, event: RelationEvent | None = None) -> None:
for chroot in sorted(leader_chroots - requested_chroots, reverse=True):
if not self._is_child_of(chroot, requested_chroots):
logger.info(f"RESET ACLS CHROOT - {chroot}")
self.client.set_acls_znode_leader(path=chroot, acls=[restricted_acl])
try:
self.client.set_acls_znode_leader(path=chroot, acls=[restricted_acl])
except NoNodeError as e:
logger.error(e, stack_info=True, exc_info=True)
continue

0 comments on commit 2589362

Please sign in to comment.