Skip to content

Commit

Permalink
optimize: remove fsync when dumping rwlock data (#4052)
Browse files Browse the repository at this point in the history
Fixes #3653
  • Loading branch information
skshetry authored Jun 16, 2020
1 parent 7c6351d commit 387867f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions dvc/rwlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ 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
2 changes: 1 addition & 1 deletion tests/func/test_repro_multistage.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def test_repro_when_new_outs_added_does_not_exist(tmp_dir, dvc):
{
"stages": {
"run-copy": {
"cmd": "python copy {} {}".format("foo", "foobar"),
"cmd": "python copy.py {} {}".format("foo", "foobar"),
"deps": ["foo"],
"outs": ["foobar", "bar"],
}
Expand Down

0 comments on commit 387867f

Please sign in to comment.