From 11d5e3e14cd001394d5abcf1628462ccf620bdf5 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi <543633+mohsen1@users.noreply.github.com> Date: Sat, 24 Oct 2026 11:38:17 +0200 Subject: [PATCH 1/3] Retry the separate-writer lock test until the lease is really released Another test in the same process can spawn git while the worker holds the lease, and the child keeps an inherited copy of the lock descriptor until its exec. The first retry then still sees the lock taken. The Proofline monorepo's main CI failed on this at 202a60ac and 9c4dacb0. --- src/agent/tests.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/agent/tests.rs b/src/agent/tests.rs index c4dd235..88fc51e 100644 --- a/src/agent/tests.rs +++ b/src/agent/tests.rs @@ -5,6 +5,7 @@ use std::io::{self, BufRead, Cursor, Read}; use std::path::{Path, PathBuf}; use std::process::Command; use std::sync::{Arc, Barrier}; +use std::time::{Duration, Instant}; #[cfg(unix)] use std::os::unix::fs::{MetadataExt as _, PermissionsExt as _, symlink}; @@ -523,10 +524,20 @@ fn a_separate_writer_lock_refuses_without_replacement_and_retry_converges() { assert_eq!(fs::read_dir(path.parent().unwrap()).unwrap().count(), 2); #[cfg(unix)] let lock_inode = fs::metadata(&lock_path).unwrap().ino(); - assert_eq!( - confirmed(home.path(), Client::Cursor).result.unwrap(), - Outcome::Installed - ); + // Another test in this process can spawn a process while the worker holds + // the lease. The child keeps an inherited copy of the lock descriptor + // until its exec, so the first retry can still find the lock taken. Retry + // within a bound; a lock that stays held still fails. + let deadline = Instant::now() + Duration::from_secs(10); + let retried = loop { + match confirmed(home.path(), Client::Cursor).result { + Err(InstallError::Busy(_)) if Instant::now() < deadline => { + std::thread::sleep(Duration::from_millis(20)); + } + result => break result, + } + }; + assert_eq!(retried.unwrap(), Outcome::Installed); assert_eq!( confirmed(home.path(), Client::Cursor).result.unwrap(), Outcome::Existing From c0684701c0166bcce1ed7a33a66209e8f3958d73 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi <543633+mohsen1@users.noreply.github.com> Date: Sat, 24 Oct 2026 11:44:02 +0200 Subject: [PATCH 2/3] Pause the lock retry with park_timeout, which the sleep ban allows The test is synchronous, so there is no runtime to block; park_timeout only waits between retries, and a spurious wake costs one extra retry. --- src/agent/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/tests.rs b/src/agent/tests.rs index 88fc51e..6b59835 100644 --- a/src/agent/tests.rs +++ b/src/agent/tests.rs @@ -532,7 +532,7 @@ fn a_separate_writer_lock_refuses_without_replacement_and_retry_converges() { let retried = loop { match confirmed(home.path(), Client::Cursor).result { Err(InstallError::Busy(_)) if Instant::now() < deadline => { - std::thread::sleep(Duration::from_millis(20)); + std::thread::park_timeout(Duration::from_millis(20)); } result => break result, } From ec0299a473cd920f5a7b9205c7b1438f27cae7e2 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi <543633+mohsen1@users.noreply.github.com> Date: Sat, 24 Oct 2026 11:48:14 +0200 Subject: [PATCH 3/3] Update tokio to 1.54.1 for RUSTSEC-2026-0386 cargo deny's advisories check fails every pull request on the AsyncFd I/O safety advisory against tokio 1.53.1. --- Cargo.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 95a6bcb..b9af8d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,7 +84,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -95,7 +95,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -682,7 +682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1857,7 +1857,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2089,7 +2089,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2390,7 +2390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2501,7 +2501,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2542,9 +2542,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "tokio" -version = "1.53.1" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -2736,7 +2736,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" dependencies = [ "memoffset", "tempfile", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2961,7 +2961,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]]