diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index d241df9d..78f0e1c0 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -1238,10 +1238,14 @@ class ConfigManager(object): pass @classmethod - def shutdown(cls): + def wait_for_sync(cls): cls._bg_sync_to_file() if cls._cfgwriter is not None: cls._cfgwriter.join() + + @classmethod + def shutdown(cls): + cls.wait_for_sync() sys.exit(0) @classmethod diff --git a/confluent_server/confluent/main.py b/confluent_server/confluent/main.py index 98c6655e..306aac4e 100644 --- a/confluent_server/confluent/main.py +++ b/confluent_server/confluent/main.py @@ -145,6 +145,9 @@ def _initsecurity(config): with open(keyfile, 'r') as keyhandle: key = keyhandle.read() configmanager.init_masterkey(key) + # We don't want to os._exit() until sync finishes from + # init above + configmanager.ConfigManager.wait_for_sync() def run():