From 387867fbbe5895cf0505aa1115ad875aa084f237 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Tue, 16 Jun 2020 14:55:36 +0000 Subject: [PATCH] optimize: remove `fsync` when dumping rwlock data (#4052) Fixes #3653 --- dvc/rwlock.py | 3 --- tests/func/test_repro_multistage.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/dvc/rwlock.py b/dvc/rwlock.py index 278b72ebf..3012a75c2 100644 --- a/dvc/rwlock.py +++ b/dvc/rwlock.py @@ -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): diff --git a/tests/func/test_repro_multistage.py b/tests/func/test_repro_multistage.py index 0507aacbc..4a9eabca4 100644 --- a/tests/func/test_repro_multistage.py +++ b/tests/func/test_repro_multistage.py @@ -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"], }