Kafka consumers never recover after SESSTMOUT caused by SQLite pool stall, taskbroker stays up without consumers
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Shell
- Estrellas
- 9.7k
- Forks
- 2k
- Merge medio
- 3 d 2 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/self-hosted
-
Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
getsentry/self-hosted#4644 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
getsentry/self-hosted#4518 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Waiting for: Product Owner
Dificultad 3/5 1-2 días Aptitud para principiantes 73/100
getsentry/self-hosted#4642 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Waiting for: Community
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
getsentry/self-hosted#4637 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Waiting for: Product Owner
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
getsentry/self-hosted#4634 ·
Los mantenedores suelen responder en 2 días
Todos los issues de getsentry/self-hosted
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
ajithakdev/claude-desktop-rpm#43 ·
Los mantenedores suelen responder en 1 día
-
documentation enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aws/aws-networking-best-practices#256 ·
Los mantenedores suelen responder en 2 días
-
area:terraform source:reader type:content-error
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
stephrobert/blog-roadmap#268 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
ChatGPT directory is behind mainAbiertoopenai-directory
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100