Delivery I/O runs inside the claim transaction: pool starvation, idle-in-transaction kills cause infinite redelivery, MVCC bloat
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 22/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- kafka, kotlin, mysql, postgresql
- Ambito
- backend, databases, distributed-systems
Direzione di ricerca
Start with the KDoc on CompositeMessageDeliverer, which acknowledges the open transaction, and trace where the claim, delivery and status update share one transaction. Check the hard-coded CONNECT_TIMEOUT and REQUEST_TIMEOUT and the concurrency setting against the pool size. Done means the maintainers have agreed on the lease-based claim design or the startup guard, with tests covering a delivery that outlives the server's idle timeout.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Severity: Medium-High (pool starvation, duplicate-delivery loop, DB bloat) · Area: processor transaction design · Found in: code review of main @ e5630a1
Problem
The whole cycle (claim with FOR UPDATE SKIP LOCKED → network delivery → status update) runs in one DB transaction, so a pooled connection sits idle in transaction for as long as the transport I/O takes:
- HTTP: up to 10 s connect + 30 s request timeout (hard-coded
CONNECT_TIMEOUT/REQUEST_TIMEOUT, not configurable) - Kafka:
producer.flush()blocks up todelivery.timeout.ms(120 s default)
Concrete failure modes:
- Connection-pool starvation.
concurrencyaccepts values up to 256, and each worker holds one connection for the full delivery. Nothing checks this against the pool size: Hikari's default is 10. Withconcurrency >= pool sizeand a slow downstream, okapi takes every connection and the application's own requests time out ongetConnection(). - Infinite duplicate loop under server-side timeouts. With Postgres
idle_in_transaction_session_timeout, or a MySQLwait_timeout/proxy idle timeout shorter than the delivery time, the server kills the session mid-delivery. The final update/commit fails, and every entry that was actually delivered reverts toPENDINGwithretriesunchanged. It is delivered again on the next tick, killed again, and so on for as long as the downstream stays slow.retriesnever advances, so nothing ever reachesFAILED. - MVCC bloat (Postgres). Long transactions hold back the xmin horizon on what is by design a very high-churn table (every row is inserted, then updated, then deleted), which degrades vacuum for the entire database.
- Combined with the MySQL gap-lock issue, publishers are blocked for the same duration.
The KDoc on CompositeMessageDeliverer acknowledges the open transaction, but the consequences above aren't documented or guarded against.
Suggested fix
- Preferred: a lease-based claim. In a short transaction, mark rows
PROCESSINGwithlocked_until = now + leaseTimeout(or bump aclaim_token), commit, deliver outside any transaction, then write results in a second short transaction guarded by the claim token. A reaper (or the claim query itself) reclaims rows whose lease has expired. - At minimum: fail fast or warn at startup when
concurrency≥ the pool's maximum size; make the HTTP timeouts configurable; document the required relationship between delivery timeouts andidle_in_transaction_session_timeout/lock-wait timeouts.
- Lingua principale
- Kotlin
- Stelle
- 14
- Fork
- 0
- Merge medio
- 9h 54m
- PR unite (30g)
- 11
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 softwaremill/okapi
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
softwaremill/okapi#141 ·
I maintainer di solito rispondono entro 1 giorno
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failureForse già presa @rawo l’ha presa oggi. Apertabreaking-change bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
softwaremill/okapi#137 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 1-2 giorni Idoneità per principianti 42/100
softwaremill/okapi#136 ·
I maintainer di solito rispondono entro 1 giorno
-
breaking-change bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
softwaremill/okapi#135 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 62/100
softwaremill/okapi#134 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di softwaremill/okapi
Issue simili
-
autoteam community connectors/destination/mssql connectors/source/hubspot team/use
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
airbytehq/airbyte#91201 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Source: c7 Type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
2.23
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ankidroid/Anki-Android#23042 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Submission] AI通话助手Apertasubmit-adaption submit-adaption-pre
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
BetterAndroid/android-notification-icon-project#828 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno