Kafka consumers never recover after SESSTMOUT caused by SQLite pool stall, taskbroker stays up without consumers
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by tracing taskbroker's Kafka consumer lifecycle and how it handles librdkafka session timeouts and consumer group rejoining; the issue names no source files or tests, so locate those entry points in the taskbroker code first. Reproduce or inspect recovery after a SQLite pool stall, then confirm consumers rejoin or taskbroker exits when recovery fails. The issue gives no test command or specific completion test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Self-Hosted Version
26.9.0
CPU Architecture
x86_64
Docker Version
29.9.1
Docker Compose Version
5.6.0
Machine Specification
- My system meets the minimum system requirements of Sentry
Installation Type
Upgrade path 26.4.2 -> 26.5.0 -> 26.7.0 -> 26.7.1 -> 26.9.0
Steps to Reproduce
Environment
- Sentry self-hosted 26.9.0 (taskbroker 26.9.0), Docker Compose
- Store adapter: sqlite,
delivery_mode: pull - Host: 4 vCPU, 39 GiB RAM, Ubuntu (kernel 6.8)
- Relevant config:
kafka_session_timeout_ms: 60000,full_vacuum_on_upkeep: true,vacuum_interval_ms: 30000,full_vacuum_on_start: true
Problem
After a short stall of taskbroker's SQLite connection pool, all Kafka consumers hit a session timeout, shut down, and never rejoin their consumer groups. The taskbroker process keeps running, so the container looks healthy (the self-hosted service has no healthcheck), but no tasks are consumed anymore:
Consumer group 'taskworker' has no active members.
taskworker taskworker 0 29758613 29759816 1203 - - -
Tasks pile up in Kafka until taskbroker is restarted manually. On self-hosted this eventually stops ingestion entirely: Relay can no longer fetch project configs (error fetching project state …: deadline exceeded), because the config computation tasks never run.
This happened twice within ~10 hours, with an identical sequence both times.
Logs (second occurrence, UTC)
09:55:03 ERROR get_task: taskbroker::grpc::server: Unable to retrieve pending activation: pool timed out while wa…
09:55:04 ERROR reduce:flush_reducer:flush: taskbroker::kafka::activation_writer: Unable to write …
09:55:07 ERROR reduce:flush_reducer:flush: taskbroker::kafka::activation_writer: Unable to write …
09:55:08 WARN taskbroker: failed to run maintenance vacuum pool timed out while waiting for an open connection
09:55:14 WARN upkeep::do_upkeep:handle_processing_deadline: sqlx::pool::acquire: acquired connection, but time to acquire exceeded slow threshold
09:55:14 WARN vacuum_db: sqlx::pool::acquire: acquired connection, but time to acquire exceeded slow threshold
09:56:15 WARN librdkafka: SESSTMOUT [thrd:main]: Consumer group session timed out (in join-state steady) …
09:56:17 WARN librdkafka: SESSTMOUT … (repeated for every consumer/topic)
INFO handle_events: taskbroker::kafka::consumer: Received event: Revoke(…)
INFO handle_events:shutdown: taskbroker::kafka::consumer: Actor shutdown …
INFO pre_rebalance: taskbroker::kafka::consumer: Rendezvous complete
After the last Rendezvous complete, taskbroker logs nothing at all until it is restarted. The first occurrence (23:32:55 → SESSTMOUT at 23:34:15) looks exactly the same.
Observations
- The SESSTMOUT comes almost exactly 60 s (
kafka_session_timeout_ms) after the pool recovers. - Shorter pool stalls (
time to acquire exceeded slow threshold) happen several times a day (e.g. 04:16, 04:53, 07:59, 09:21, 09:49 UTC) and usually recover on their own.vacuum_dbis involved in every one of them. - The SQLite DB is tiny (28 KB + 4 MB WAL), so size is not the issue.
- The host was not overloaded (CPU ~60–75% idle, low iowait and disk util per
sar). Only taskbroker logged timeouts; all other Kafka consumers on the host (Snuba, Sentry consumers) were unaffected. - My guess is that the frequent full VACUUM, possibly combined with a short disk latency spike, holds the database long enough to block everything else, but I can't prove that.
Expected behavior
A temporary SQLite stall should not permanently disable all consumers. After a session timeout, taskbroker should either rejoin the consumer groups or exit with an error so the container gets restarted. A healthcheck that detects "no active consumers" would also make this visible.
Workaround
A cron job runs kafka-consumer-groups --describe --group taskworker every 5 minutes and restarts taskbroker if it reports "has no active members" twice in a row. This is confirmed working and limits the outage to ~10 minutes.
Related: getsentry/self-hosted#4424 (where I first reported the resulting backlog)
Expected Result
see above
Actual Result
see above
Event ID
No response
- Lingua principale
- Shell
- Stelle
- 9.7k
- Fork
- 2k
- Merge medio
- 3g 2h
- PR unite (30g)
- 16
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/self-hosted
-
Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
getsentry/self-hosted#4644 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
getsentry/self-hosted#4518 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
Waiting for: Product Owner
Difficoltà 3/5 1-2 giorni Idoneità per principianti 73/100
getsentry/self-hosted#4642 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
Waiting for: Community
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
getsentry/self-hosted#4637 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Waiting for: Product Owner
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
getsentry/self-hosted#4634 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di getsentry/self-hosted
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ajithakdev/claude-desktop-rpm#43 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
aws/aws-networking-best-practices#256 ·
I maintainer di solito rispondono entro 2 giorni
-
area:terraform source:reader type:content-error
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
stephrobert/blog-roadmap#268 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
openai-directory
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100