From 5ac0c1f7043abfa301997ab625c053fbde53815b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 18 Mar 2026 11:11:22 -0700 Subject: [PATCH] fix upload limit wait counter behavior --- seaweed-volume/src/server/handlers.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/seaweed-volume/src/server/handlers.rs b/seaweed-volume/src/server/handlers.rs index 164fac492..57d39d51d 100644 --- a/seaweed-volume/src/server/handlers.rs +++ b/seaweed-volume/src/server/handlers.rs @@ -2051,14 +2051,16 @@ pub async fn post_handler( if current <= state.concurrent_upload_limit { break; } + // Go increments UploadLimitCond on every loop iteration (L184), + // not just on timeout. + metrics::HANDLER_COUNTER + .with_label_values(&[metrics::UPLOAD_LIMIT_COND]) + .inc(); // Wait for notification or timeout if tokio::time::timeout_at(deadline, state.upload_notify.notified()) .await .is_err() { - metrics::HANDLER_COUNTER - .with_label_values(&[metrics::UPLOAD_LIMIT_COND]) - .inc(); return json_error_with_query( StatusCode::TOO_MANY_REQUESTS, "upload limit exceeded",