From 9ad1eee2f82967c0d1802acb7422d09f3a91d8af Mon Sep 17 00:00:00 2001 From: Niran Babalola Date: Wed, 11 Feb 2026 11:07:10 -0600 Subject: [PATCH] fix(gobrr): close rate limiter semaphore on shutdown After shutdown, the replenisher stops adding permits but signers are blocked forever in acquire_rate_permit().await. Call limiter.close() so pending acquire_owned() calls return AcquireError, which the signer already handles gracefully by breaking out of its loop. Without this, all signers with target_tps configured deadlock on shutdown, waiting for permits that will never come. --- crates/gobrr/src/runner.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/gobrr/src/runner.rs b/crates/gobrr/src/runner.rs index cf72849..01a09e2 100644 --- a/crates/gobrr/src/runner.rs +++ b/crates/gobrr/src/runner.rs @@ -133,7 +133,13 @@ pub async fn start_load_test(config_path: &str) -> Result { loop { tokio::select! { biased; - _ = replenish_shutdown.recv() => break, + _ = replenish_shutdown.recv() => { + // Close the semaphore so signers blocked in + // acquire_rate_permit() get an AcquireError + // and can check their shutdown channel. + limiter.close(); + break; + } _ = interval.tick() => { let available = limiter.available_permits(); if available < max_permits {