Multiple Sentry consumers repeatedly become unhealthy due to Kafka coordinator/session timeouts

オープン
#4,485 コメント 10 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, docker-compose, kafka

調査の方向性

添付されたログと標準の Docker Compose 設定から始め、Kafka コーディネーターのタイムアウト、コンシューマーのリバランス、Sentry および Snuba のコンシューマーにおけるコンテナの unhealthy への遷移に焦点を当てます。影響を受けたコンシューマーサービスを比較し、再現可能な設定変更または復旧変更を特定します。コンシューマーが正常な状態を維持し、手動で再起動することなくメッセージを継続的に処理できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Waiting for: Product Owner
Self-Hosted Version

26.8

CPU Architecture

x86_64

Docker Version

29.7.2

Docker Compose Version

v5.5.0

Machine Specification
  • My system meets the minimum system requirements of Sentry
Installation Type

Upgrade from 26.7.2

Steps to Reproduce
  1. Deploy a self-hosted Sentry installation using the standard Docker Compose configuration.

  2. Start all Sentry services and verify that the consumers initially become healthy.

  3. Leave the Sentry installation running under normal workload.

  4. Allow the Sentry consumers to process events, performance metrics, buffered segments, monitor tasks, and other Kafka topics.

  5. After some time, multiple consumers begin losing communication with the Kafka consumer group coordinator.

  6. The issue can be observed in the logs with messages such as:

    Consumer group session timed out (in join-state steady) after 45000 ms
    without a successful response from the group coordinator
    
  7. The consumers subsequently report errors such as:

    KafkaError{code=NOT_COORDINATOR}
    KafkaError{code=_WAIT_COORD}
    KafkaError{code=COORDINATOR_LOAD_IN_PROGRESS}
    
  8. The affected containers eventually become unhealthy.

  9. Restarting the Sentry stack temporarily restores the consumers to a healthy state.

  10. The problem recurs several times per day, requiring approximately 4 Sentry restarts per day.

Affected containers include:

sentry-snuba-subscription-consumer-events-1
sentry-process-segments-1
sentry-post-process-forwarder-errors-1
sentry-monitors-clock-tasks-1
sentry-ingest-monitors-1
sentry-generic-metrics-consumer-1
sentry-events-consumer-1

The issue also affects Snuba's Kafka consumer for:

snuba-commit-log
Expected Result

Sentry consumers should remain connected to their Kafka consumer groups and continue processing messages normally during continuous operation.

The consumer containers should remain healthy and should not require manual restarts.

Temporary Kafka coordinator changes or consumer group rebalances should recover automatically without causing the containers to become unhealthy.

Actual Result

Multiple Sentry consumers periodically lose communication with the Kafka group coordinator and experience approximately 45-second consumer session timeouts.

The logs contain messages such as:

Consumer group session timed out (in join-state steady) after 45000 ms
without a successful response from the group coordinator

followed by:

Broker: Not coordinator
Local: Waiting for coordinator

and:

Broker: Coordinator load in progress

The consumers revoke their Kafka partitions and attempt to rejoin the consumer group.

For example:

Partitions to revoke:
[Partition(topic=Topic(name='events'), index=0)]

and:

Commit failed:
KafkaError{code=_WAIT_COORD,val=-180,str="Local: Waiting for coordinator"}

Snuba exhibits the same behavior on snuba-commit-log, suggesting that the problem is not isolated to a single Sentry consumer.

Additionally, sentry-process-segments-1 frequently reports processing delays such as:

Batch process is taking longer than 5 seconds.

and:

Waited on the process pool longer than 20 seconds.
Waiting for 1 results.

After these Kafka coordinator/session problems, multiple containers become unhealthy.

Restarting the Sentry stack temporarily resolves the problem, but the same behavior returns several times per day, requiring approximately 4 manual restarts per day.

_sentry-process-segments-1_logs.txt
_sentry-post-process-forwarder-errors-1_logs.txt
_sentry-monitors-clock-tasks-1_logs.txt
_sentry-ingest-monitors-1_logs.txt
_sentry-generic-metrics-consumer-1_logs.txt
_sentry-events-consumer-1_logs.txt
_sentry-snuba-subscription-consumer-events-1_logs.txt

Event ID

No response

主要言語
Shell
スター
9.7k
フォーク
2k
平均マージ
3日 2時間
マージ済み PR(30日)
16

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/self-hosted のほかの issue

getsentry/self-hosted の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。