Skip to content

fix(anthropic): Close span on GeneratorExit #11914

fix(anthropic): Close span on GeneratorExit

fix(anthropic): Close span on GeneratorExit #11914

Triggered via pull request March 12, 2026 08:12
Status Cancelled
Total duration 1m 54s
Artifacts
Matrix: GraphQL
All GraphQL tests passed
3s
All GraphQL tests passed
Fit to window
Zoom out
Zoom in

Annotations

20 errors and 1 warning
GraphQL (3.6, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.6, ubuntu-22.04)
The operation was canceled.
GraphQL (3.12, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.12, ubuntu-22.04)
The operation was canceled.
GraphQL (3.14t, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.14t, ubuntu-22.04)
The operation was canceled.
GraphQL (3.11, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.11, ubuntu-22.04)
The operation was canceled.
GraphQL (3.8, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.8, ubuntu-22.04)
The operation was canceled.
GraphQL (3.13, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.13, ubuntu-22.04)
The operation was canceled.
GraphQL (3.10, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.10, ubuntu-22.04)
The operation was canceled.
GraphQL (3.14, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.14, ubuntu-22.04)
The operation was canceled.
GraphQL (3.9, ubuntu-22.04)
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
GraphQL (3.9, ubuntu-22.04)
The operation was canceled.
All GraphQL tests passed
Process completed with exit code 1.
Test GraphQL
Canceling since a higher priority waiting request for Test GraphQL-webb/anthropic/handle-generator-exit exists
Missing test coverage for GeneratorExit scenario: sentry_sdk/integrations/anthropic.py#L367
The PR adds try/finally handling to close spans when GeneratorExit is raised (e.g., when consumers break early from a streaming iterator), but no test verifies this behavior. Without a test that simulates early iterator termination, there's no regression protection for this fix.