-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Deadlock when downloading git dependencies #2987
Comments
Looks like the same issue as #2566. |
So looks like a textbook deadlock: git sources keep locks while other git sources are being updated, and the locks are captured in no particular order (resolution graph is non deterministic because of HashMaps). Looks like making locking order deterministic is not an option: how would one order git dependencies from different packages? |
Yeah this happens frequently with two git deps, and you're right that it's because git locks aren't ordered. Unfortunately it's actually not possible to order locks because we don't know the set of locks we need to take at the beginning, or at least not with the current strategy. Some options we have here are:
I'd probably prefer the latter option (or another alternative) to solve this, dropping and re-acquiring locks sounds like a pain! |
What about using a single lock for all git deps? Hm, and what if the resolution DAG includes the same git dependency twice, but with different revisions? Is it true that it is impossible to build a package with such dependencies because both revisions should be checked out to the same directory? EDIT: apparently this is false, because they will be checked out to different directories. |
Some more alternatives:
|
Hm I think I like the single lock idea actually. It's pretty bad in terms of UI (makes the feature almost unusable), but it should be rarer than crates.io and it's better UI than deadlocking. So sounds good to me! |
The question is who should own that single |
@matklad yeah I'd expect |
Deadlocks with git dependencies Only a test for now to verify that it actually fails on Travis. Hopefully will close #2987
Repro:
The text was updated successfully, but these errors were encountered: