-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
[WIP] [internal] fix immutable inputs bug on macOS #15140
Conversation
[ci skip-build-wheels]
[ci skip-build-wheels]
FWIW the test causes me no errors on Linux. I ran this and killed it after 81 successes: COUNT=0; while ./cargo test -p process_execution -- duplicate_immutable_input_digests; do echo -e "\n\n$((COUNT+=1)): Success\n---"; done |
@jsirois: What do you think about the idea to add a sequence number to the final path? #13899 (comment) |
@tdyas I'm not sure. What is the error output in the test for you from this block of code?: pants/src/rust/engine/process_execution/src/immutable_inputs.rs Lines 121 to 126 in fc3dec3
I need to page this back in more fully, but having to use a sequence number may imply (pending your error output), that our in-process locking regime is broken. If that's the case, it seems to me just using the Pex atomic_directory strategy (which is now even battle tested in multi-threaded / multi-process environments with the switch from POSIX locks to BSD locks: pex-tool/pex#1702) would be better; i.e.: instead of having both mutexes that sometimes fail for unknown reasons and FS locks (the sequence is a variant of this) to back those failures up, we have just 1 locking mechanism, file locks. |
running 1 test failures: failures: test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 97 filtered out; finished in 0.06s error: test failed, to rerun pass '--lib' |
Ok, yeah. That's what we've been consistently seeing on Mac and Linux with these error paragraphs. That says the parent directory exists, is a dir, and is 755 and the child target directory already exists!, is a dir and is 555; which means the in-memory Mutexing is broken somehow IIUC. |
I'll try a fix with the BSD lock API then. |
Thanks Tom! |
For my reference, BSD lock is |
#13899 describes a bug with immutable inputs where there is a failure to move the materialized digest's directory atomically on macOS.
No fix yet, this PR only contains a unit test that reproduces the issue.
[ci skip-build-wheels]