Claude Sonnet 5.5 · Heavy

span-buffer-multiprocess-enhancement-with-health-monitoring-sentry

Sentry · Python · M · 100–299 lines · 4 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
2 of 2
Comments published
3
Comments matching a bug
2
Comments not matching
1
Cost of this PR
$1.133

Published comments (3)

highbugsrc/sentry/spans/consumers/process/flusher.py:253-259

Hung flusher process is never killed because isinstance check excludes SpawnProcess — `SpawnProcess` subclasses `BaseProcess`, not `multiprocessing.Process`, so the `isinstance` guard is likely False and a hung flusher is never killed. The old process keeps its shards while `_create_process_for_shards` starts a replacement, which can produce duplicate segments.

mediumbugtests/sentry/spans/consumers/process/test_consumer.py:60-62

time.sleep(0.1) is a no-op because time.sleep is monkeypatched in the test — Replace it with a deadline-based poll until `messages` is non-empty, or capture the real sleep before patching.

mediumbugsrc/sentry/spans/consumers/process/flusher.py:337-347

`break` on an expired join deadline skips `process.terminate()` for remaining flushers — Flusher processes keep running after `join()` returns, whereas the old code always terminated them after the wait loop. Remove the `break` and always call `process.terminate()` after each wait, or add a separate terminate loop after the wait loop.

Gold bugs found (2)

highThe restart path only kills a hung flusher if it is a multiprocessing.Process, but spawn-context workers are SpawnProcess, so hung processes are never killed and a duplicate flusher is started for the same shards.
mediumjoin() breaks out of the per-process loop when the shared deadline expires, skipping termination of the remaining flusher processes and leaving them running after shutdown.

Gold bugs missed (0)

None.