Scheduler processes one batch per worker per tick: default throughput capped at <10 msg/s, backlog grows unbounded
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Start in the OutboxScheduler in okapi-core, where scheduleWithFixedDelay runs processNext(batchSize) once per worker per tick, and read processBatch to see how each tick's transaction is opened. Change it so the loop keeps draining while a batch comes back full, with one transaction per iteration and a time or iteration budget that still lets stop() return promptly. Done means a sustained high publish rate no longer backs up the queue under default settings, stop() stays responsive, and the existing tests pass; the issue also asks for a benchmark of sustained throughput.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Severity: High (performance / unbounded backlog) · Area: okapi-core OutboxScheduler · Found in: code review of main @ e5630a1
Problem
Each scheduler tick has every worker call processNext(batchSize) exactly once, using scheduleWithFixedDelay. That puts a hard ceiling on throughput:
max throughput ≈ concurrency × batchSize / (interval + batch processing time)
With the defaults (concurrency = 1, batchSize = 10, interval = 1s) that is under 10 messages/second, regardless of how fast the DB and transport are. Any sustained publish rate above that grows the backlog without bound, and latency grows linearly with it. A burst of 100k messages takes about 3 hours to drain with the defaults, even when each batch takes milliseconds.
Raising interval to cut idle polling makes this worse. Raising batchSize makes transactions longer (see the related issues on gap locks and delivery inside the transaction).
Suggested fix
In processBatch, keep draining while the previous batch was full. Each iteration gets its own transaction, and the loop is bounded by a time or iteration budget so stop() stays responsive:
do {
val n = transactionRunner.runInTransaction { outboxProcessor.processNext(config.batchSize) }
} while (n == config.batchSize && running.get() && !budgetExceeded())
That way the poll interval only governs idle latency, not peak throughput. The benchmarks should cover a sustained-rate scenario as well as fixed-backlog drains.
- Lenguaje dominante
- Kotlin
- Estrellas
- 14
- Forks
- 0
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 9
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 softwaremill/okapi
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
softwaremill/okapi#141 ·
Los mantenedores suelen responder en 1 día
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failurePosiblemente ocupada @rawo la tomó hace 2 días. Abiertobreaking-change bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
softwaremill/okapi#137 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 1-2 días Aptitud para principiantes 42/100
softwaremill/okapi#136 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 Medio día Aptitud para principiantes 62/100
softwaremill/okapi#134 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
softwaremill/okapi#133 ·
Los mantenedores suelen responder en 1 día
Todos los issues de softwaremill/okapi
Issues similares
-
[Submission] 招商银行Abiertosubmit-adaption submit-adaption-pre
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
BetterAndroid/android-notification-icon-project#848 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
"Tick" is confusingAbiertobug
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
orgzly-revived/orgzly-android-revived#1132 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
commons-app/apps-android-commons#7275 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
liberation-data/drivine4j#682 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
developmentwithyash/yaan#14 ·
Los mantenedores suelen responder en 2 días