fix(batcher): Reset lock and flusher in child after fork #6163
@sentry/warden / warden
completed
Apr 29, 2026 in 1m 20s
1 issue
Low
Test leaves SpanBatcher in mutated state, can pollute subsequent tests - `tests/tracing/test_span_streaming.py:1619-1621`
The parent process mutates shared batcher state (_span_buffer, _running_size, _active.flag, _flush_event, _running = False) before forking, but only releases the lock afterward — it never restores those fields. The at-fork hook only runs after_in_child, so the parent retains the mutated state. If another test later reuses the same client/batcher (or if the batcher's flusher thread observes _running = False), behavior may diverge from expectations and cause flaky failures.
4 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| code-review | 0 | 1m 18s | $1.53 |
| find-bugs | 1 | 53.0s | $2.36 |
| skill-scanner | 0 | 36.6s | $0.66 |
| security-review | 0 | 50.8s | $0.74 |
Duration: 3m 38s · Tokens: 1.0M in / 12.9k out · Cost: $5.29 (+extraction: $0.00)
Loading