-
Notifications
You must be signed in to change notification settings - Fork 614
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
fix(git): lock cache on resolve #5051
fix(git): lock cache on resolve #5051
Conversation
4f95fdb
to
96ef9db
Compare
CI failure seems to be urelated. |
Should be ready for initial review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me, thank you.
We do have a test for this ( |
Ok I was able to reproduce on main: rm -rf cache_dir
echo "example-pkg-a @ git+https://github.com/pypa/sample-namespace-packages.git#subdirectory=pkg_resources/pkg_a
" | ./target/debug/uv pip compile - --cache-dir cache_dir &
echo "example-pkg-b @ git+https://github.com/pypa/sample-namespace-packages.git#subdirectory=pkg_resources/pkg_b
" | ./target/debug/uv pip compile - --cache-dir cache_dir & I think it's hard to reproduce in a test because we likely need to be accessing across processes. |
Works as expected on your branch! |
thanks @charliermarsh for a quick turnaround! 👍 |
Fixes a concurrency issue when multiple processes are installing the same package in different virtual environments from Git ref (not a specific Git commit).
Symptoms
That's how some of symptoms looked like in our case:
Cause of the issue
It is the same command that is failing -
git clone
, and I think it's happening because it was trying to first get the repo to dereference thefix-distributed-test
branch:Given a remote source distribution, return a precise variant, if possible.
And it's happening w/i acquiring a lock around cache.
Fix
I thinks we can reuse the existing
fetch
method that has already lock around cache:https://github.com/astral-sh/uv/pull/5051/files#diff-f58bb99dee2c4922d156ace3e7de651f0d9a81fc8e9447a2ad865de5c53543fcR61-R68
Questions