mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3336] [Other] Exclude refused batch admissions from completion metrics #4575
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4575
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3336
Author: @oscarlius
Created: 10/20/2026
Status: 🔄 Open
Base:
main← Head:fix/batch-admission-accounting-20261018📝 Commits (1)
010593dfix(serve): exclude refused batch admissions from completion metrics📊 Changes
2 files changed (+46 additions, -18 deletions)
View changed files
📝
serve/server.py(+27 -17)📝
serve/test_parallel.py(+19 -1)📄 Description
Problem and result
A request refused by every BGEN slot returns HTTP 503, but its history row is still (finish, prompt_tokens, prompt_read) = (length, 51, None), and successful completion/token/latency metrics include it. This fix records an error history row with zero processed prompt tokens and excludes this pre-admission rejection from successful completion and latency totals. The regression also checks Retry-After, Prometheus metrics, slot cleanup and a later successful request.
Related discussion
Continues #3042 after the v0.2.1.4 tracker reset. The original passed the new format check, but GitHub refused to reopen the rebased branch; the reset bot explicitly suggested a new linked pull request.
Closes #3040. This is an accounting follow-up to #1994; admission and retry policy stay the same.
Approach
Classify GpuBusy as a pre-admission refusal only when no DONE segment has settled and no output token was emitted. Preserve accounting for settled or partly generated work.
Validation
Passed:
py -3.12 -m ruff check --output-format json serve/server.py serve/test_parallel.py(Ruff 0.2.1): 21 existing diagnostics, same as unmodified main; zero new diagnostics.Windows, Python 3.12.7:
python -m unittest serve.test_parallel.ParallelService.test_bgen_refused_for_good_is_a_retryable_503_and_frees_the_slots -v— 1 passed on010593d6274577bb6ff00200a9890fd84a4da4b9.python -m unittest serve.test_parallel serve.test_prometheus -v— 48 tests, passed; final test resultOK.python -m py_compile serve/server.py serve/test_parallel.pyandgit diff --check 9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4...HEADpassed.Failed:
serve/server.pyat9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4(v0.2.1.4), the same focused test fails:('length', 51, None) != ('error', 0, None). No candidate test failure observed.Not run:
Limits
Fresh Python processes and loopback HTTP prove the server accounting behavior, not native engine admission or model quality. No runtime default is changed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.