From cbee00d3bba5eb0497c7c130092c028bedd9f096 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 19 Jul 2021 10:25:35 -0400 Subject: [PATCH] Fix initial collective join Initial collective join combined with the orderly collective startup hit a chicken and egg problem. Disable initting on first enrollment to let enrollment drive that specific initialization to restore behavior. --- confluent_server/confluent/collective/manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/confluent_server/confluent/collective/manager.py b/confluent_server/confluent/collective/manager.py index 488704fc..abb4fc64 100644 --- a/confluent_server/confluent/collective/manager.py +++ b/confluent_server/confluent/collective/manager.py @@ -244,6 +244,7 @@ def get_myname(): def handle_connection(connection, cert, request, local=False): global currentleader global retrythread + global initting connection.settimeout(5) operation = request['operation'] if cert: @@ -395,6 +396,11 @@ def handle_connection(connection, cert, request, local=False): tlvdata.send(connection, {'error': 'Invalid token'}) connection.close() return + if not list(cfm.list_collective()): + # First enrollment of a collective, since the collective doesn't + # quite exist, then set initting false to let the enrollment action + # drive this particular initialization + initting = False myrsp = base64.b64encode(myrsp) fprint = util.get_fingerprint(cert) myfprint = util.get_fingerprint(mycert)