From 6a784e3a1c9ac7b15f3f9bc0ccaffe7177a06e8b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 10 Oct 2018 14:49:33 -0400 Subject: [PATCH] Ensure sync is complete prior to leaving configmanager sync The initialization lock is meant to avoid collective and generic initialization stepping on each other. This is somewhat reduced in efficacy if one has a sync running while the other is changing relevant data. --- confluent_server/confluent/config/configmanager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index afd45983..cfd8f29d 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -626,7 +626,7 @@ def rollback_clear(): _cfgstore = _oldcfgstore _oldtxcount = 0 _oldcfgstore = None - ConfigManager._bg_sync_to_file() + ConfigManager.wait_for_sync(True) def clear_configuration(): @@ -990,6 +990,7 @@ class ConfigManager(object): if 'nodes' not in self._cfgstore: self._cfgstore['nodes'] = {} self._bg_sync_to_file() + self.wait_for_sync() def get_collective_member(self, name): return get_collective_member(name)