-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
Parallell pex creation fails due to possible race conditions in package installation #1968
Comments
Yeah, Pex has an atomic_directory abstraction it uses for all such things: Clearly something is broken there though. Pex is used by Pants quite heavily and it runs many Pex processes in parallel as well. That had smoked out these issues ~2 years ago, but there is clearly something wrong (see #1969). I explained a bit over on that issue, but if you're on Pex 2.1.112 can you try exporting |
@tapetersen, @christopherfrieler had success using |
I'm running the builds with pex installed in a .venv and get the following (along with the same errors when trying with the env-var)
Will try to install it outside venv and try again. and see if I get any difference |
Hmm even Outside of a venv with Error without that warning
Error with that warning (both having the variable set from commandline
Also running with |
Ok, thanks for that data. The warning is expected, the continued failures are not. I need to think more here. |
@jsirois No problem, like I said no rush for us. We can work around it in the makefile without any problems but happy to provide data if you want to resolve it. |
Actually - one question presents itself. Are your errors confined to missing files in paths that are prefixed by |
Hmm not sure about all errors but from a quick glance all I can see do indeed appear under that directory. |
Excellent - thank you. |
I repro - which is great. Thank you for setting that gist up. I should be able to get to the bottom of this pretty quickly. |
This was broken by pex-tool#1961 which did not account for the two unlocked uses of AtomicDirectory by the pex.resolver for wheel building and installing. Although those directories deserve a second look as candidates for exclusive locking, we have seen no known issues with those directories since introduction of AtomicDirectory up until pex-tool#1961. As such, this change just restores the prior behavior for those two cases. Fixes pex-tool#1968
This was broken by #1961 which did not account for the two unlocked uses of AtomicDirectory by the pex.resolver for wheel building and installing. Although those directories deserve a second look as candidates for exclusive locking, we have seen no known issues with those directories since introduction of AtomicDirectory up until #1961. As such, this change just restores the prior behavior for those two cases. Fixes #1968
Alright - thanks again @tapetersen for your help tracking this down. The fix in #1974 is now released in Pex 2.1.113. |
We're using pex with makefiles and parallell jobs in CI and are noticing spurious errors like the one below
The other pex built fine and if I retry it will work. Problem is probably made worse by having all wheels cached so no time is spent downloading them which makes it more likely to run into races when installing.
This would probably need some locking around the installed_wheels folder or more fine grained locking/atomik operations for the real installation folder.
It's not urgent for us as I can avoid making those in parallell or ensure separate pexdirs but it was somewhat of a nasty issue to debug and would perhaps save someone the time and frustration in the future.
The text was updated successfully, but these errors were encountered: