From f2f25fe912ec6c606be40249a55be792495ab5be Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 15 Sep 2023 15:25:26 -0400 Subject: [PATCH] Implement ready tracking When going through the dramatic scenario of initializing collective, take _ready down so that other code can pause operation appropriately. --- confluent_server/confluent/config/configmanager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 1ae5e579..54888dd1 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -831,6 +831,9 @@ _oldcfgstore = None _oldtxcount = 0 +def config_is_ready(): + return _ready + def rollback_clear(): global _cfgstore global _txcount @@ -848,6 +851,8 @@ def clear_configuration(): global _txcount global _oldcfgstore global _oldtxcount + global _ready + _ready = False stop_leading() stop_following() _oldcfgstore = _cfgstore @@ -858,6 +863,7 @@ def clear_configuration(): def commit_clear(): global _oldtxcount global _oldcfgstore + global _ready # first, copy over old non-key globals, as those are # currently defined as local to each collective member # currently just 'autosense' which is intended to be active @@ -877,6 +883,7 @@ def commit_clear(): pass ConfigManager.wait_for_sync(True) ConfigManager._bg_sync_to_file() + ready = True cfgleader = None