Merge pull request #3076 from efiop/rwlock_sync

rwlock: flush and fsync
This commit is contained in:
Ruslan Kuprieiev
2020-01-12 01:35:13 +02:00
committed by GitHub
+3
View File
@@ -50,6 +50,9 @@ def _edit_rwlock(lock_dir):
yield lock
with open(path, "w+") as fobj:
json.dump(lock, fobj)
# NOTE: flush and fsync to ensure that rwlock contents are saved
fobj.flush()
os.fsync(fobj.fileno())
def _infos_to_str(infos):