Repository navigation
MAINT: Add service shutdown error context - #3281
Merged
Roman Lutz (romanlutz) merged 3 commits intoOct 19, 2026
Merged
Roman Lutz (romanlutz) merged 3 commits into
Roman Lutz (romanlutz) merged 3 commits into
Conversation
7 of 25 tasks
Slai.life (huong8373tt-beep)
force-pushed
the
fix/p311-08-service-shutdown-context
branch
from
October 17, 2026 14:14
f3d317b to
6164ca6
Compare
Contributor
|
Using error.add_note here fits Python 3.11 exception handling nicely. It attaches the specific service closure context without wrapping or altering the underlying exception type, so single error raises keep their exact identity and tracebacks intact while multi failure scenarios retain the existing BaseExceptionGroup structure. The lifecycle tests in test_analytics_lifecycle verify both the single failure and grouped failure cases cleanly. |
Roman Lutz (romanlutz)
approved these changes
Oct 18, 2026
Roman Lutz (romanlutz)
enabled auto-merge
October 18, 2026 00:17
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.
Description
Implements the remaining service-shutdown investigation for P311-08 from #3166.
When
close_services_asynccollects failures from cached backend service closure and analytics service closure, the original exceptions now receive safe operation-name notes before they are re-raised or grouped. This preserves exception identity, type, traceback, cancellation behavior, ordering, and the existing single-error/BaseExceptionGroupcontract.Tests and Documentation
uv run --frozen --no-sync pytest -q --basetemp=D:\oss_contrib\pyrit-p311-08\.pytest-tmp-service-shutdown tests/unit/backend/test_analytics_lifecycle.py— 12 passed.uv run --frozen --no-sync pre-commit run --files pyrit/backend/services/service_lifecycle.py tests/unit/backend/test_analytics_lifecycle.py— passed, including Ruff and ty checks.git diff --check— passed.Slai Agent Runtime assisted with investigation, implementation, and tests. The account owner reviewed and authorized this contribution.