fix(pixel): guard task group exception groups during stream revocation cleanup - #5600
Open
vaibhavsrv wants to merge 1 commit into
Open
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
vaibhavsrv
force-pushed
the
fix/pixel-stream-revocation-cleanup
branch
from
September 17, 2026 03:35
08bd3b2 to
3f44dce
Compare
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.
Why this matters
In the Pixel inference perimeter service (
ods/extensions/services/pixel-inference/app/main.py), in-flight streaming generations are monitored concurrently by a credential watcher task in_guarded(). When a token is revoked during active streaming, the watcher completes with aShareError("credential_no_longer_valid"), prompting_guarded()to cancel the active StarletteStreamingResponse.__call__task (work) during cleanup. On Python 3.11+, cancelling Starlette's AnyIO task group causesawait workto raise anExceptionGroupcontaining task group cancellation and child exceptions. Because_guarded()only suppressedasyncio.CancelledError, this unhandledExceptionGroupescaped thefinallyblock, clobbering the intendedShareErrorand raising an unhandled task group exception instead of cleanly notifying the caller of credential invalidation.This change conditionally includes
BaseExceptionGroupin the suppression tuple when available on Python 3.11+ runtimes, ensuring that task group cancellation during stream revocation cleanup is safely suppressed while preserving the primary watcherShareErrorfor clean propagation. Existing stream timeouts, response bounds, and authorization precedence remain strictly untouched.Validation
pytest ods/extensions/services/pixel-inference/tests/test_inference_sharing.py -k test_stream_revocation_terminates_and_closesfails with an unhandledExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception: ShareError('credential_no_longer_valid'))escaping_guarded().gateway.ShareError("credential_no_longer_valid")and closes the underlying transport socket with exit code 0.Overlap check
fix(pixel): isolate model compatibility): Focuses on model selection profile compatibility and does not touch the streaming response task group guards or inference perimeter cleanup.fix(installer): report...): Modifies installer output formatting and does not overlap with Pixel inference service ASGI handlers.feat(installer): gate...): Adds installer readiness gating without modifying inference streaming response lifetimes or error unwrapping.Risk / AI disclosure
AI-assisted investigation, implementation and CLI regressions. This strengthens ASGI task group cancellation suppression during stream revocation cleanup, not runtime admission. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.
Follow-up integration evidence
Composed with #5579 at 4fa6ad1 without conflicts. Production and test diffs passed together; adjacent pixel inference deadline and sharing contracts remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.