Skip to content

test: check request cancellation before backend dispatch - #8953

Open
pskiran1 wants to merge 21 commits into
mainfrom
spolisetty/tri-1741-implement-request-cancellation-for-trt-backend
Open

test: check request cancellation before backend dispatch#8953
pskiran1 wants to merge 21 commits into
mainfrom
spolisetty/tri-1741-implement-request-cancellation-for-trt-backend

Conversation

@pskiran1

@pskiran1 pskiran1 commented Sep 3, 2026

Copy link
Copy Markdown
Member

What does the PR do?

This PR expands request-cancellation integration coverage for non-batched identity and TensorRT models.

Adds queued-cancellation and response-cache assertions to the scheduler tests.
Creates rate-limited TensorRT and resource-holder models for backend-dispatch coverage.
Adds TensorRT cancellation, normal queued execution, and unaffected-request cases.

Checklist

  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Commit Type:

Check the conventional commit type
box here and add the label to the github PR.

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

Related PRs:

triton-inference-server/core#522
triton-inference-server/tensorrt_backend#127

Where should the reviewer start?

Test plan:

  • CI Pipeline ID:

Caveats:

Background

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
@pskiran1 pskiran1 changed the title ci: feat: Check request cancellation before backend dispatch- #522 ci: feat: Check request cancellation before backend dispatch Sep 3, 2026
@pskiran1 pskiran1 changed the title ci: feat: Check request cancellation before backend dispatch ci: Check request cancellation before backend dispatch Sep 3, 2026
@pskiran1
pskiran1 marked this pull request as ready for review September 3, 2026 13:18
@pskiran1
pskiran1 marked this pull request as draft September 3, 2026 13:20
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds integration coverage for cancelling queued inference requests before backend dispatch and improves cancellation synchronization and diagnostics.

  • Adds shared helpers for callback synchronization, metrics polling, execution counts, pending-request state, and cancellation confirmation.
  • Covers queued cancellation and response-cache behavior for non-batched identity models.
  • Adds TensorRT rate-limiter coverage proving that a cancelled request is skipped while an adjacent live request executes.
  • Logs request-scoped cancellation results after the cancellation call completes.

Confidence Score: 5/5

The PR appears safe to merge, with no outstanding findings or new actionable defects.

The previous findings were manually resolved, and the current implementation uses bounded pending-state polling and logs cancellation only after the core cancellation call completes. The sole change since the previous review is formatting-only and does not alter behavior.

Important Files Changed

Filename Overview
src/grpc/infer_handler.h Adds request-scoped logging after core cancellation succeeds or fails and releases cancellation errors correctly.
qa/L0_request_cancellation/cancellation_test_utils.py Introduces bounded synchronization and metrics helpers shared by cancellation integration tests.
qa/L0_request_cancellation/scheduler_test.py Adds queued non-batched cancellation and response-cache assertions while replacing fixed cancellation sleeps with callback synchronization.
qa/L0_request_cancellation/trt_cancellation_test.py Verifies that rate-limited TensorRT cancellation skips only the cancelled request and allows adjacent live work to execute.
qa/L0_request_cancellation/test.sh Builds the required identity and TensorRT model repositories and runs the new cache and rate-limiter scenarios.

Sequence Diagram

sequenceDiagram
  participant Client
  participant gRPC as gRPC handler
  participant Limiter as Rate limiter
  participant Backend
  Client->>gRPC: Submit inference request
  gRPC->>Limiter: Queue request
  Client->>gRPC: Cancel request
  gRPC->>Limiter: Issue core cancellation
  Limiter-->>gRPC: Cancelled response
  gRPC-->>Client: CANCELLED
  Note over Limiter,Backend: Cancelled request is not dispatched
Loading

Reviews (13): Last reviewed commit: "Fix pre-commit" | Re-trigger Greptile

Comment thread qa/L0_request_cancellation/scheduler_test.py Outdated
Comment thread qa/L0_request_cancellation/trt_cancellation_test.py Outdated
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Comment thread qa/L0_request_cancellation/trt_cancellation_test.py Outdated
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Comment thread qa/L0_request_cancellation/trt_cancellation_test.py Outdated
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
…trt-backend' of https://github.com/triton-inference-server/server into spolisetty/tri-1741-implement-request-cancellation-for-trt-backend
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
@pskiran1
pskiran1 marked this pull request as ready for review September 7, 2026 08:50
@pskiran1
pskiran1 marked this pull request as draft September 7, 2026 08:50
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
@pskiran1
pskiran1 marked this pull request as ready for review September 8, 2026 05:28
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
@pskiran1 pskiran1 added PR: ci Changes to our CI configuration files and scripts PR: test Adding missing tests or correcting existing test labels Sep 8, 2026
@pskiran1 pskiran1 changed the title ci: Check request cancellation before backend dispatch test: check request cancellation before backend dispatch Sep 8, 2026
@pskiran1 pskiran1 removed the PR: ci Changes to our CI configuration files and scripts label Sep 8, 2026

@whoisj whoisj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: test Adding missing tests or correcting existing test

Development

Successfully merging this pull request may close these issues.

2 participants