ExposedTransactionRunner: Exposed's default 3x retry re-runs claim+delivery on SQLException, multiplying duplicate deliveries
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 62/100
Línea de trabajo
Start with ExposedTransactionRunner.runInTransaction in the okapi-exposed module, which wraps the block in Exposed's transaction(database), and with processNext() to see the claim, deliver, update sequence. Check how Exposed's DatabaseConfig retry setting reaches that call. Done when a test shows the deliverer is invoked once when the store update throws SQLException, and the existing tests still pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Severity: Medium (duplicate delivery amplification) · Area: okapi-exposed ExposedTransactionRunner · Found in: code review of main @ e5630a1
Problem
ExposedTransactionRunner.runInTransaction is transaction(database) { block() }. Exposed retries the entire block on SQLException up to DatabaseConfig.defaultMaxAttempts times. The default is 3, which I confirmed in the bytecode of exposed-core 1.6.0.
For the outbox scheduler the block is processNext(): claim → network delivery → update. If the update or commit fails with an SQLException (deadlock victim, serialization failure, connection reset, oversized last_error, see the related issue), Exposed rolls back and re-runs the whole cycle immediately. It re-claims the same rows and delivers them again, up to 3 times per tick, with no backoff. The delivery side effect isn't transactional, so these retries only add duplicates and load on the downstream.
The purger and the metrics reads are idempotent, so retries are harmless there. The processor path is the problem.
Suggested fix
Disable Exposed's automatic retry for okapi's runner, e.g. transaction(database) { maxAttempts = 1; block() } (or the equivalent DatabaseConfig), and let okapi's own scheduler retry on the next tick. Add a test asserting that a deliverer is invoked once when the store update throws SQLException.
- Lenguaje dominante
- Kotlin
- Estrellas
- 14
- Forks
- 0
- Merge medio
- 9 h 54 min
- PR fusionados (30 d)
- 11
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ó hoy. 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
-
breaking-change bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
softwaremill/okapi#135 ·
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
-
autoteam community connectors/destination/mssql connectors/source/hubspot team/use
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
airbytehq/airbyte#91201 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Source: c7 Type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
2.23
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ankidroid/Anki-Android#23042 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Submission] AI通话助手Abiertosubmit-adaption submit-adaption-pre
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
BetterAndroid/android-notification-icon-project#828 · 1 comentario ·
Los mantenedores suelen responder en 1 día