feat: check request cancellation before backend dispatch - #522
Open
pskiran1 wants to merge 3 commits into
Open
Conversation
pskiran1
marked this pull request as ready for review
August 31, 2026 14:05
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
pskiran1
marked this pull request as draft
August 31, 2026 14:08
Greptile SummaryAdds a final cancellation check after scheduler and rate-limiter waiting but before backend dispatch.
Confidence Score: 5/5The PR appears safe to merge, with no outstanding correctness or repository-rule findings. The current code removes cancelled ordinary requests at the final backend-dispatch boundary, preserves sequence slots, avoids empty backend calls, and excludes unsuccessful responses from cache insertion. The only previous finding was manually resolved after Greptile conceded that fixed sequence positions make the exception intentional. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Scheduler forms payload] --> B[Rate limiter / execution-slot wait]
B --> C[TritonModelInstance::Schedule]
C --> D{Sequence batching?}
D -->|Yes| E[Preserve fixed sequence slots]
D -->|No| F[Complete and remove cancelled requests]
F --> G{Requests remain?}
G -->|No| H[Return success without backend dispatch]
G -->|Yes| I[Prepare requests]
E --> I
I --> J[Backend execute callback]
J --> K{Successful response?}
K -->|Yes| L[Eligible for response-cache insertion]
K -->|No| M[Deliver without caching]
Reviews (6): Last reviewed commit: "Merge branch 'main' of https://github.co..." | Re-trigger Greptile |
…into spolisetty/tri-1741-implement-request-cancellation-for-trt-backend
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
pskiran1
marked this pull request as ready for review
September 3, 2026 15:34
20 tasks
Vinya567
approved these changes
Sep 10, 2026
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.
A request cancelled while waiting for an execution slot is no longer passed to the backend. The check sits in
TritonModelInstance::Schedule, the single point every scheduler routes through on the way toTRITONBACKEND_ModelInstanceExecute...