[Bug]: HTTP cluster storage returns 400 for valid empty results
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.7k
- Forks
- 2.8k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 489
Description
System Info
Platform-independent HTTP cluster-storage behavior on current main.
Reproduction
tensorrt_llm/serve/cluster_storage.py::jsonify() documents that only False and None results should map to HTTP 400, but the implementation uses generic truthiness:
status_code=200 if result else 400
As a result, valid empty values such as an empty stored string ("") or an empty prefix result ({}) are returned with HTTP 400 even though the operation succeeded.
Expected behavior
Return HTTP 400 only when the result is exactly False or None. Other JSON-serializable results, including empty strings and empty containers, should return HTTP 200.
Actual behavior
All falsey values are treated as failures.
Proposed fix
Use explicit identity checks for False and None, with CPU-only regression tests covering empty successful results and the existing failure cases.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tensorrt_llm/serve/cluster_storage.py at jsonify() and inspect how result values determine the HTTP status. Add CPU-only regression coverage for empty stored strings, empty prefix results, and the existing False and None failures. Done means successful empty JSON-serializable results return HTTP 200 while exactly False and None return HTTP 400.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100