ref(strawberry): Simplify span creation #5647
+7
−14
Merged
GitHub Actions / warden
completed
Mar 12, 2026 in 2m 6s
1 issue
Medium
Span context manager not properly closed on exception - span leaks and scope corruption - `sentry_sdk/integrations/strawberry.py:189-204`
The new code calls self.graphql_span.__enter__() at line 189 and self.graphql_span.__exit__(None, None, None) at line 204, but if an exception is thrown into the generator at the yield statement (line 196), the code after yield never executes. This leaves the span unfinished and corrupts the scope because __exit__ restores the old span. Additionally, passing (None, None, None) to __exit__ prevents the span from being marked with INTERNAL_ERROR status when an exception occurs.
4 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| code-review | 0 | 54.3s | $0.26 |
| find-bugs | 1 | 1m 52s | $0.42 |
| skill-scanner | 0 | 21.0s | $0.03 |
| security-review | 0 | 19.3s | $0.03 |
Duration: 3m 27s · Tokens: 647.3k in / 8.5k out · Cost: $0.74 (+dedup: $0.00)
Loading