Fix spurious client-side failures in agentic benchmark - #3296
Merged
Conversation
Running benchmark_agentic.py against a long-context model reported a 0.05-0.5% turn failure rate even though the server returned HTTP 200 for every single request. Both causes were aiohttp client defaults: - ClientSession() applies a default ClientTimeout(total=5*60), which aborts turns that legitimately exceed 5 minutes at high concurrency with a large --output-len-max. It surfaces as asyncio.TimeoutError, whose str() is empty, so the recorded error message was blank and the failure had no attributable reason. - Pooled keep-alive connections were reused after the server had already closed them during an idle gap between turns, raising ServerDisconnectedError. Add make_client_session() with total=None and a force_close connector, used for both the health check and the benchmark session. Also record the exception type alongside its message, and print a failure breakdown after the success rate so any future failure is self-identifying. On Qwen3.5-397B-A17B-FP8 over 21,490 turns (50 groups, concurrency 16), this takes the success rate from 99.79-99.97% to 100.00%. Signed-off-by: wenxindongwork <wenxindong@google.com>
DescriptionStart with a short description of what the PR does and how this is a change from The rest of the description includes relevant details and context, examples:
If the change fixes a Github issue, please include a link, e.g.,: TestsPlease describe how you tested this change, and include any instructions and/or ChecklistBefore submitting this PR, please make sure:
|
Signed-off-by: wenxindongwork <wenxindong@google.com>
wenxindongwork
force-pushed
the
worktree-agentic-bench-client-fixes
branch
from
July 30, 2026 17:47
b96e1a1 to
e006095
Compare
wenxindongwork
marked this pull request as ready for review
July 30, 2026 17:48
wenxindongwork
enabled auto-merge (squash)
July 30, 2026 18:11
helloworld1
pushed a commit
that referenced
this pull request
Aug 17, 2026
Signed-off-by: wenxindongwork <wenxindong@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
scripts/vllm/benchmarking/agentic_benchmark/benchmark_agentic.pyagainst a long-context model reports a small but persistent turn failure rate (0.05-0.5% in my runs) even though the server returns HTTP 200 for every single request. Both causes are aiohttp client defaults, not server behaviour:aiohttp.ClientSession()appliesClientTimeout(total=5*60). Turns that legitimately take longer -- high concurrency with a large--output-len-max-- are aborted client-side. It surfaces asasyncio.TimeoutError, whosestr()is the empty string, so"error": str(e)recorded the failure with no reason at all, making it undiagnosable from the report.ServerDisconnectedError. This was the only residual failure mode once the timeout was fixed.Fix
make_client_session()--total=None(no cap on a single turn;sock_connect=30retained) andTCPConnector(force_close=True)so a fresh connection is used per request. Used for both the health check and the benchmark session.str(e)can never produce a blank reason.Failure Breakdownafter the success-rate line, tallied by reason, so any future failure is self-identifying.Result
On
Qwen/Qwen3.5-397B-A17B-FP8(TPU v7x-8, TP8 + attention-DP4, 65536 context), a concurrency sweep at 2/4/6/8/12/16 showed 99.79-99.97% success in every run, with every failure attributable to the two causes above. With this change the full run -- 50 groups at concurrency 16, 800 rollouts, 21,490 turns over 4.6 hours -- completed at 100.00% success, 0 failed.Report excerpt showing the new breakdown format (synthetic failures):
Testing
yapf --diffclean on the changed file.print_report()exercised directly with synthetic failing stats to verify the breakdown renders and sorts by frequency.timeout.total is None,connector._force_close is True).Note on token counts
An earlier revision of this description quoted a total-tokens-processed figure for the validation run. That number came from the script's client-side token estimates, which are inaccurate in both directions -- the prompt count tokenizes the Python repr of the message list, and the completion count re-encodes detokenized text. #3298 fixes that by using the server-reported
usage. The counts quoted above (rollouts, turns, success rate, duration) are unaffected by that issue, so they stand as-is.#3298 touches the same function in this file, so whichever lands first will need a trivial rebase of the other.