-
-
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
pex creation fails under pants w/ No such file or directory
error
#1051
Comments
Pants now invokes multiple instances of mypy concurrently: it's possible that this is related. But the contents of the |
Looking very closely at the last line, I think this may be caused by the I can't provide a causal chain reason yet though so I'll leave this open to work on a bit harder. |
this happens in CI (circleci), not OSX. |
Aha, ok - almost certainly something else then. I'll take a look. |
Notes:
|
Narrowing down a bit more, this error involves running the Pex PEX which is the one released by the Pex proejct and marked as
|
Alright, explanation in hand. The issue here is
For atomic mutable directory creation we'll need an interprocess lock. Another approach would be to continue with |
Do either of these solutions need to be applied unconditionally, or we could try to detect when it's unsafe and only use these fixes then? |
They need to be applied unconditionally since detecting when its safe amounts to detecting if there are other similar processes racing which amounts to either implementing an interprocess lock (the proposed solution) or else eliminating the need for a lock (the alternative solution). |
Use this new mode to ensure directories Pex creates that contain Python code are created exactly once so that the implicit Python bytecode compilation process is not thwarted by racing directory creation. Fixes pex-tool#1051
Use this new mode to ensure directories Pex creates that contain Python code are created exactly once so that the implicit Python bytecode compilation process is not thwarted by racing directory creation. Fixes #1051
yay! thanks for fixing @jsirois ! |
@jsirois need to reopen this... Since I am seeing this with the latest release.
|
Ok. Assuming Linux posix APIs are not broken, which is a very safe bet, the observation of temporary pyc files created by Python can only be via |
Previously `dir_hash` (and `pex_hash`) were able to observe in-flight bytecode compilation which would lead to observe-delete-failedhash sequencing. Fixes pex-tool#1051
seeing this randomly from time to time in different CI runs.
The text was updated successfully, but these errors were encountered: