-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Bootstrap should better handle cases where the lock is hold by nobody #135972
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
Comments
I thought we changed this in #132737... That can happen if the PID is somehow not available |
We don't use the existence of a lockfile to indicate that another process is running. Rather we take an advisory lock on the lockfile. Advisory locks are automatically unlocked by the OS when the process that holds them exits for whatever reason.
It prints the content of the lockfile which should contain the pid of the process that last locked it (even after said process exited). |
That's very strange. Maybe a race between two bootstrap processes; P1: Creates lockfile and takes lock |
We could probably fix this by being smarter and writing more atomically but since the PID is just for diagnostics, maybe we can just check .is_empty() before printing the first message |
That's weird, cause I'm sure there were no other processes running at the same time 🤔 |
Rollup merge of rust-lang#136009 - clubby789:pidfile-race, r=jieyouxu bootstrap: Handle bootstrap lockfile race condition better Fixes rust-lang#135972 Tested by: - Starting one build - In another terminal, `echo -n '' > build/lock` - Attempt to invoke bootstrap a second time
Summary
I just saw this:
Which made me quite confused confused. is
,
the process? (not unheard of, I have a binary called,
) Is the process empty string?The actual result is (most likely) that because rust-analyzer OOM'ed after using >44GiB of RAM today, the lock was not released and so is held by no process (thus, empty string).
Command used
(although it does not matter)
Expected behaviour
Bootstrap explicitly saying that no process is holding the lock & possibly even suggesting removing the lockfile.
Operating system
NixOS
HEAD
99768c8
The text was updated successfully, but these errors were encountered: