Skip to content

Conversation

@akshayutture-augment
Copy link

@akshayutture-augment akshayutture-augment commented Nov 14, 2025

Test 6


Replicated from ai-code-review-evaluation/sentry-cursor#6


Note

Introduce a multiprocess span flusher with per-process health monitoring and a new CLI option to cap flusher processes; wire through factory, enhance metrics/backpressure handling, and update tests.

  • Spans Processing:
    • Multiprocess flusher: Refactor SpanFlusher to manage multiple processes mapped to shard sets, with per-process buffers and restart logic (_ensure_processes_alive).
    • Health/Backpressure: Track process_healthy_since/process_backpressure_since; enforce backpressure across processes; aggregate Redis memory checks over all buffers; improved join/terminate behavior.
    • Metrics/Tracing: Add per-shard tags to timers and segment size metrics; set sentry_spans_buffer_shards.
    • Factory Wiring: ProcessSpansStrategyFactory accepts flusher_processes and passes max_processes to SpanFlusher.
    • CLI: Add --flusher-processes to process-spans consumer in sentry/consumers/__init__.py.
  • Tests:
    • Update tests to transactional DB, add timing waits, assert new backpressure structure, and add test_flusher_processes_limit.
  • Docs:
    • CLAUDE.md: Add Python anti-pattern guidance to use isinstance() over hasattr() for unions.

Written by Cursor Bugbot for commit 9bf83b0. Configure here.

@akshayutture-augment
Copy link
Author

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants