-
Notifications
You must be signed in to change notification settings - Fork 1
fix: remove double decrement on retryable request failures #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -593,13 +593,6 @@ impl Router { | |
| false | ||
| }; | ||
|
|
||
| // Keep a clone for potential cleanup on retry | ||
| let worker_for_cleanup = if load_incremented { | ||
| Some(worker.clone()) | ||
| } else { | ||
| None | ||
| }; | ||
|
|
||
| let response = self | ||
| .send_typed_request( | ||
| headers, | ||
|
|
@@ -617,18 +610,6 @@ impl Router { | |
| let status = response.status(); | ||
| worker.record_outcome(status.is_success() || status.is_client_error()); | ||
|
|
||
| // For retryable failures, we need to decrement load since send_typed_request | ||
| // won't have done it (it only decrements on success or non-retryable failures) | ||
| if is_retryable_status(response.status()) && load_incremented { | ||
| if let Some(cleanup_worker) = worker_for_cleanup { | ||
| cleanup_worker.decrement_load(); | ||
| RouterMetrics::set_running_requests( | ||
| cleanup_worker.url(), | ||
| cleanup_worker.load(), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| response | ||
|
Comment on lines
610
to
613
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removing the retry-path cleanup here assumes Useful? React with 👍 / 👎. |
||
| }, | ||
| // should_retry predicate | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load counter leak on early-return error paths
Low Severity
The PR's assumption that
send_typed_requestalways handles load decrements isn't fully accurate. Whenintra_node_data_parallel_size > 1andextract_dp_rankfails,send_typed_requestreturnsINTERNAL_SERVER_ERROR(500) at line 778 without decrementing. Since 500 is retryable, the removed retry cleanup block was the only thing that would have decremented the load in this path. Now, each such failure permanently leaks +1 into theload_counter, making the worker appear increasingly overloaded over time.Reviewed by Cursor Bugbot for commit 070d34c. Configure here.