From 571f3ed0c49353a6ceec040bb406a4b364b3766f Mon Sep 17 00:00:00 2001 From: clubby789 Date: Fri, 24 Jan 2025 16:56:00 +0000 Subject: [PATCH] bootstrap: Handle bootstrap lockfile race condition better --- src/bootstrap/src/bin/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs index b65527741952e..8ebd6b8aa54cd 100644 --- a/src/bootstrap/src/bin/main.rs +++ b/src/bootstrap/src/bin/main.rs @@ -57,7 +57,9 @@ fn main() { } err => { drop(err); - if let Ok(pid) = pid { + // #135972: We can reach this point when the lock has been taken, + // but the locker has not yet written its PID to the file + if let Some(pid) = pid.ok().filter(|pid| !pid.is_empty()) { println!("WARNING: build directory locked by process {pid}, waiting for lock"); } else { println!("WARNING: build directory locked, waiting for lock");