Repository navigation
Conversation
ska2704
requested review from
Abdul-0x4A,
andyland,
dmitsf,
ethanwharris,
justusschock,
k223kim and
tchaton
as code owners
October 17, 2026 01:32
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #789 +/- ##
===================================
Coverage 86% 86%
===================================
Files 40 40
Lines 3343 3364 +21
===================================
+ Hits 2870 2897 +27
+ Misses 473 467 -6 🚀 New features to boost your workflow:
|
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 this PR do?
Fixes #787. This follows up on the batch failure reported in #340.
An exception from one request's
decode_requestorencode_responsecurrently makes every request in its batch fail. Handle these errors per request so valid siblings still receive their results.Only successfully decoded inputs reach
batch,predict, andunbatch, with their contexts kept in the same order. If every decode fails, prediction is skipped. Errors in these shared operations still fail the surviving batch. Tracking requests that still need a response prevents a later shared failure from sending a second error to an already rejected request.The API docstrings describe the behavior. Tests cover HTTP and ordinary exceptions, context alignment, all-invalid input, shared-stage failures, and concurrent HTTP requests through a worker. The HTTP tests check the actual prediction batch size so they cannot pass by processing requests individually.
Validation:
PATH="$PWD/.venv/bin:$PATH" PYTHONPATH="$PWD/src" python -m pytest --cov=litserve tests/ -q --color=no --durations=15: 384 passed, 10 skipped on macOS arm64 with Python 3.12.11. The explicit source path fixes local subprocess imports from the editable installation.pre-commit run --all-files: passed with pre-commit 4.3.0.uv build: source distribution and wheel built successfully.Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃