ExposedTransactionRunner: Exposed's default 3x retry re-runs claim+delivery on SQLException, multiplying duplicate deliveries
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 62/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Kotlin
- スター
- 14
- フォーク
- 0
- 平均マージ
- 9時間 54分
- マージ済み PR(30日)
- 11
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
softwaremill/okapi のほかの issue
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
softwaremill/okapi#141 ·
メンテナーはふだん 1 日以内に返信
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failure対応中かも @rawo が今日担当しました。 オープンbreaking-change bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
softwaremill/okapi#137 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 1〜2日 初心者へのやさしさ 42/100
softwaremill/okapi#136 ·
メンテナーはふだん 1 日以内に返信
-
breaking-change bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
softwaremill/okapi#135 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
softwaremill/okapi#133 ·
メンテナーはふだん 1 日以内に返信
softwaremill/okapi の issue をすべて見る
似ている issue
-
autoteam community connectors/destination/mssql connectors/source/hubspot team/use
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
airbytehq/airbyte#91201 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Source: c7 Type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
2.23
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ankidroid/Anki-Android#23042 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
[Submission] AI通话助手オープンsubmit-adaption submit-adaption-pre
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
BetterAndroid/android-notification-icon-project#828 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信