Fix clustered master startup race condition

When starting up a cluster master, sending the initial aes key event
needs to wait for the event server to fully start. Prior to this change
we'd only try for one second and there was no logging of a failure.
This commit is contained in:
Daniel A. Wozniak 2023-12-27 16:25:19 -07:00 committed by Daniel Wozniak
parent 0a88399996
commit 0cc5b51aba
2 changed files with 4 additions and 3 deletions

View file

@ -965,10 +965,13 @@ class MasterPubServerChannel:
with salt.utils.event.get_master_event(
self.opts, self.opts["sock_dir"], listen=False
) as event:
event.fire_event(
success = event.fire_event(
data,
salt.utils.event.tagify(self.opts["id"], "peer", "cluster"),
timeout=30000, # 30 second timeout
)
if not success:
log.error("Unable to send aes key event")
def __getstate__(self):
return {

View file

@ -55,8 +55,6 @@ def test_cluster_key_rotation(
if time.monotonic() - start > timeout:
assert False, f"Drop file never removed {dfpath}"
time.sleep(30)
keys = set()
# Validate the aes session key for all masters match