Skip to content

Commit

Permalink
Merge pull request #3076 from efiop/rwlock_sync
Browse files Browse the repository at this point in the history
rwlock: flush and fsync
  • Loading branch information
efiop authored Jan 11, 2020
2 parents b7f9e73 + c190643 commit 3e97886
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dvc/rwlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 3e97886

Please sign in to comment.