Scheduler processes one batch per worker per tick: default throughput capped at <10 msg/s, backlog grows unbounded
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 52/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Kotlin
- Étoiles
- 14
- Forks
- 0
- Merge moyen
- 14 h 16 min
- PR mergées (30 j)
- 9
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de softwaremill/okapi
-
bug
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
softwaremill/okapi#141 ·
Les mainteneurs répondent en général sous 1 jour
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failurePeut-être pris @rawo l’a pris il y a 2 jours. Ouvertebreaking-change bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
softwaremill/okapi#137 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 4/5 1-2 jours Accessibilité débutants 42/100
softwaremill/okapi#136 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 3/5 Une demi-journée Accessibilité débutants 62/100
softwaremill/okapi#134 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 22/100
softwaremill/okapi#133 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de softwaremill/okapi
Issues similaires
-
[Submission] 招商银行Ouvertesubmit-adaption submit-adaption-pre
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
BetterAndroid/android-notification-icon-project#848 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
"Tick" is confusingOuvertebug
Difficulté 1/5 1-3 heures Accessibilité débutants 70/100
orgzly-revived/orgzly-android-revived#1132 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
commons-app/apps-android-commons#7275 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
liberation-data/drivine4j#682 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
developmentwithyash/yaan#14 ·
Les mainteneurs répondent en général sous 2 jours