-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dvc: lock
file ignored when command is run more than one time
#2822
Comments
@MrOutis could you triage this and see if it's an actual bug or expected? |
@shcheklein , @algomaster99 , this is the expected behavior. Reading https://github.com/retinator/flufl.lock source code was a delightful experience (read it with a British accent); @algomaster99 , if you are interested to know how it works internally, I truly recommend you to grab a glass/cup of your favorite beverage and go through the code in one sit, it is short and well documented 👌 By the way, you can go to I'll close this issue since the lock created by DVC doesn't get ignored: dvc run sleep 1000 &
dvc status
dvc status |
@MrOutis That seems pretty weird. We set the lifetime to be over a year https://github.com/iterative/dvc/blob/master/dvc/lock.py#L62 so why does it break after one check? CC @Suor |
@efiop , @algomaster99 was trying to emulate a lockfile by using |
@MrOutis Oh! Makes total sense! Sorry, didn't get that one right away. Great research! 🙏 To summarize, the way flufl sets a lifetime, is it sets mtime on the file to a 1 year from now on. |
As far as I remember there is a grace period of several second built in, to compensate for time being not in sync across network. So if you touch it and then run status fast enough you'll get locked. Just a guess. |
Version
Problem
.dvc/lock
is ignored when advc
command is run for the second time.Expected behaviour
When
dvc status
is run for the second time, it should throw an error since.dvc/lock
isn't deleted yet so it should have prevented the command from running.Reproduce
lock
file.dvc status
. (Throws error)ls .dvc
to check iflock
is still present.dvc status
again.Runs successfully. It should not since
lock
is still present.The text was updated successfully, but these errors were encountered: