mirror of
https://github.com/xcat2/confluent.git
synced 2025-07-10 23:01:33 +00:00
Wrap bdb deletion in same lock that sync itself uses
If os.remove happens at a bad time, it causes an unfortunate behavior in dbm. Serialize this sort of operation to avoid the bad behavior.
This commit is contained in:
@ -646,12 +646,13 @@ def commit_clear():
|
||||
global _oldcfgstore
|
||||
_oldcfgstore = None
|
||||
_oldtxcount = 0
|
||||
todelete = _config_areas + ('globals', 'collective', 'transactioncount')
|
||||
for cfg in todelete:
|
||||
try:
|
||||
os.remove(os.path.join(ConfigManager._cfgdir, cfg))
|
||||
except OSError as oe:
|
||||
pass
|
||||
with _synclock:
|
||||
todelete = _config_areas + ('globals', 'collective', 'transactioncount')
|
||||
for cfg in todelete:
|
||||
try:
|
||||
os.remove(os.path.join(ConfigManager._cfgdir, cfg))
|
||||
except OSError as oe:
|
||||
pass
|
||||
ConfigManager.wait_for_sync(True)
|
||||
ConfigManager._bg_sync_to_file()
|
||||
|
||||
|
Reference in New Issue
Block a user