Skip to content

Follow up: isolate per-operation cancellation state - #998

Draft
bmehta001 wants to merge 1 commit into
bhamehta001/support-cancellationfrom
bhamehta001/cancellation-operation-runtime-followup
Draft

Follow up: isolate per-operation cancellation state#998
bmehta001 wants to merge 1 commit into
bhamehta001/support-cancellationfrom
bhamehta001/cancellation-operation-runtime-followup

Conversation

@bmehta001

Copy link
Copy Markdown
Contributor

Scope

Follow-up to #994. This contains the larger per-operation cancellation runtime that was removed from #994 to keep the original fix focused and reviewable.

It addresses the deferred concurrency/lifetime findings around request epochs, per-operation deadlines, generator ownership, session destruction, and concurrent embeddings cancellation.

This PR is intentionally draft and must not block #994.

Give each inference invocation a stable cancellation identity so queued, running, and completed requests cannot cancel one another or outlive their session state. Isolate deadlines and generators per operation, make model/session ownership teardown-safe, and preserve legacy synchronous cancellation behavior while enabling the upcoming operation ABI.

Files changed:
- sdk_v2/cpp/CMakeLists.txt
- sdk_v2/cpp/src/inferencing/model_load_manager.* and model_session_lease.h
- sdk_v2/cpp/src/inferencing/generative/{audio,chat,embeddings}/**
- sdk_v2/cpp/src/inferencing/session/**
- sdk_v2/cpp/src/manager.cc and sdk_v2/cpp/src/service/** handlers
- sdk_v2/cpp/test/CMakeLists.txt and focused internal cancellation tests

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16cc8b6f-2bc4-4469-bf59-f21439569349
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview Aug 13, 2026 6:21pm

Request Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant