Repository navigation
Conversation
Capture the HTTP response code before serializing and deleting the Triton error. Add generate and generate_stream coverage for INTERNAL and UNAVAILABLE model failures. Assisted-by: OpenAI Codex Signed-off-by: Amrinder Randhawa <272048731+amarrtech@users.noreply.github.com>
|
Assisted-by: OpenAI Codex <codex@openai.com> Signed-off-by: Amrinder Randhawa <272048731+amarrtech@users.noreply.github.com>
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
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.
What does the PR do?
Preserves the original Triton model error status for the HTTP
/generateand/generate_streamendpoints.GenerateRequestClass::InferResponseCompletepreviously passederrtoAddErrorJson, which serializes and deletes it, and then calledHttpCodeFromError(err). Capturing the HTTP code before serialization removes that use-after-free and restores the intended mappings, includingINTERNALto 500 andUNAVAILABLEto 503.The L0 HTTP regression drives both endpoints through first-response
INTERNALandUNAVAILABLEfailures using the existingmock_llmmodel.Checklist
<commit_type>: <Title>pre-commit install, pre-commit run --all) — all hooks passed on the four changed files; the repository-wide suite was not run.Commit Type:
Related PRs:
None.
Where should the reviewer start?
src/http_server.cc, whereHttpCodeFromError(err)now runs beforeAddErrorJson(err)deletes the error. The regression entry point isqa/L0_http/generate_error_status_test.py.Test plan:
uvx --from pre-commit pre-commit run --show-diff-on-failure --color=never --files src/http_server.cc qa/L0_http/test.sh qa/L0_http/generate_error_status_test.py qa/python_models/generate_models/mock_llm/1/model.py— passed all hooks.python3 -m py_compile qa/L0_http/generate_error_status_test.py qa/python_models/generate_models/mock_llm/1/model.py— passed.git diff --check— passed.qa/L0_http/test.sh— not run locally; it requires a packaged Linux Triton server and Python backend. The new regression is invoked by this suite and covers 500/503 mappings on both generate endpoints.Caveats:
The full L0 HTTP runtime test requires Triton's packaged Linux QA environment, which was unavailable from this macOS source checkout.
Background
Gateways and clients use HTTP status codes to distinguish caller errors from model-engine failures. Returning 400 for an unhealthy engine can suppress appropriate retry, failover, and health behavior and obscures the operator diagnosis.
OpenAI Codex assisted with the implementation and regression test; the commit records that assistance.
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)