-
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
repro: LockError due to unnecessary write lock #5795
Comments
Egregiously, |
Deleting the |
Seems that the lock error happens in the stage Because some of the But we can remove |
This isn't really a bug, it's more of a known limitation in current DVC. DVC is not designed in a way to allow running more than one stage at a time within a single repository instance/workspace. There are existing feature requests to support this behavior, and it is something we would like to get to eventually: See these related issues: The |
Closing in favor of #5007 |
Hi @maximerischard !
|
For the record: Closed #5007 in favor of this one, since it contains a bit more contenxt. |
Thank you so much for responding to the issue. It's hugely encouraging that dvc devs and the community are so responsive. To respond to a few comments:
There's no question that a lock needs to be obtained when the command is actually executed. But the
I would question this slightly. The read-write lock functionality has no reason to exist except to enable this kind of manually parallel workflow. The docs are quite clear on this topic: “Currently, dvc repro is not able to parallelize stage execution automatically. If you need to do this, you can launch dvc repro multiple times manually.” The latter is exactly what I'm trying to do, and I would say dvc is a few bug fixes away from fulfilling that promise. (I would say dvc is a handful of coroutines away from delivering “parallelized stage execution” but that's certainly a trickier task.)
I can see how that makes sense. It's a tricky design decision, thank you for explaining the reasoning behind it. |
Fixed by #5815 |
Bug Report
Description
A LockError is raised if two dvc steps that share a dependency are run in parallel.
Reproduce
The add the following to
dvc.yaml
:The run
dvc repro step1
anddvc repro step2
in two separate terminals. The second command will result in a LockError:The reason seems to be that:
step1
grabs a read lock ondependency.txt
step2
triggersdependency.txt.dvc
to be “run“dependency.txt.dvc
requests a write lock ondependency.txt
Step (3) seems to be the problematic one, there should be no need for a write lock on
dependency.txt
to be requested.Expected
Two
dvc repro
ordvc run
commands that read from the same file should be able to run in parallel.Workaround
step2
can be run withdvc repro --single-item step2
but this should not be necessary.Environment information
Output of
dvc doctor
:The text was updated successfully, but these errors were encountered: