Skip to content

Commit 3e97886

Browse files
authored
Merge pull request #3076 from efiop/rwlock_sync
rwlock: flush and fsync
2 parents b7f9e73 + c190643 commit 3e97886

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dvc/rwlock.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ def _edit_rwlock(lock_dir):
5050
yield lock
5151
with open(path, "w+") as fobj:
5252
json.dump(lock, fobj)
53+
# NOTE: flush and fsync to ensure that rwlock contents are saved
54+
fobj.flush()
55+
os.fsync(fobj.fileno())
5356

5457

5558
def _infos_to_str(infos):

0 commit comments

Comments
 (0)