From 2740e61a239ce8684e7e35d8088c0672015b5e96 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Tue, 26 May 2026 12:37:32 +0300 Subject: [PATCH] fix(neuron,candle): name lifetime on acquire_pool_lock Lifetime elision fails when a function has two reference parameters and returns a borrow: rustc can't infer whether the MutexGuard's lifetime ties to `pool` or `model_id`. The non-CUDA build skipped this code path (cfg-gated), so the error only surfaced on the GPU build at https://git.lair.cafe/helexa/cortex/actions/runs/162. The guard borrows the pool, so name the lifetime on `pool` and the return type. `model_id` keeps its independent (elided) lifetime. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/neuron/src/harness/candle.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/neuron/src/harness/candle.rs b/crates/neuron/src/harness/candle.rs index 76cdb18..569ae3e 100644 --- a/crates/neuron/src/harness/candle.rs +++ b/crates/neuron/src/harness/candle.rs @@ -453,10 +453,10 @@ const POOL_LOCK_WARN_THRESHOLD: Duration = Duration::from_secs(2); /// the warn happens at the call site — the request whose lock-wait is /// slow is the one that knows its prompt_len and other context. #[cfg(feature = "cuda")] -async fn acquire_pool_lock( - pool: &tokio::sync::Mutex, +async fn acquire_pool_lock<'a>( + pool: &'a tokio::sync::Mutex, model_id: &str, -) -> tokio::sync::MutexGuard<'_, super::tp::WorkerPool> { +) -> tokio::sync::MutexGuard<'a, super::tp::WorkerPool> { let start = std::time::Instant::now(); // Tick once at the threshold so a stuck request shows up in // journalctl even while it's still waiting. Without this the wait