Repository navigation
Conversation
A 4xx response other than 408 and 429 does not change when the same request is sent again. Raise it after one request instead of retrying it up to max_retries times. Fixes THUDM#2561
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
CI runs each test file with python, not pytest. Without NUM_GPUS = 0 and a __main__ block, the file ran no tests. Add both, and add the file to the cpu-unittest list.
This branch has not been deployed
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.
Fixes #2561.
Problem.
_postinslime/utils/http_utils.pyretries every exception up tomax_retries=60times with a 1 s sleep, also anhttpx.HTTPStatusErrorfor a 4xx response. The same request gets the same 4xx again, for example a prompt longer than the context length. So the caller sees the error only after about 60 s and 60 requests.Change. In the
exceptblock, anhttpx.HTTPStatusErrorwith a 4xx status other than 408 and 429 is logged and raised after one request. Everything else is unchanged: 408, 429, 5xx and transport errors are still retried.With
--use-distributed-post,poststill falls back to the local client after any actor error. So a 4xx is sent twice there (before: up to 2 x 60 times). This PR does not change that fallback.Tests.
tests/test_http_post_retry.pywithhttpx.MockTransport,asyncio.sleeppatched andmax_retries=3: 400, 404 and 422 send one request and raise. 408, 429, 500 and 503 send 3.NUM_GPUS = 0and a__main__block, and it is in thecpu-unittestlist ofpr-test.yml.j2(pr-test.ymlregenerated).tests/test_server_control.py(23 passed) andtests/test_external_sglang_engines.py(5 passed).ruff,blackandisortfrom the pre-commit config pass on the changed files.test_score_centering_binary.py(needspybase64, not installed here).test_streaming_rollout.pyhas the same 2 failures on main and on this branch.AI assistance: Claude Code wrote this change and its test, and ran the checks above, under my direction. I reviewed it and will answer the review.