Browse Source

fix upload limit wait counter behavior

pull/8539/head
Chris Lu 1 week ago
parent
commit
5ac0c1f704
  1. 8
      seaweed-volume/src/server/handlers.rs

8
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",

Loading…
Cancel
Save