mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3042] [CLOSED] [Other] Exclude refused batch admissions from completion metrics #4418
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#4418
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/3042
Author: @oscarlius
Created: 10/18/2026
Status: ❌ Closed
Base:
main← Head:fix/batch-admission-accounting-20261018📝 Commits (1)
4e1a44cfix(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
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 on23a4f428d78655b92b05048620570465469533b1.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 e88ee39d1d6be6e3364183af3b39b62a7ed6f211...HEADpassed.Failed:
serve/server.pyate88ee39d1d6be6e3364183af3b39b62a7ed6f211(0.2.0-beta), 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.