OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failure
維護者通常 1 天內回覆
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
研究方向
Start in OutboxProcessor.processNext, where listener.onEntryProcessed runs right after store.updateAfterProcessingBatch and before the transaction commits. Then read OutboxScheduler and the TransactionRunner used around runInTransaction to see where an after-commit notification could go. Done means listener callbacks fire only after a successful commit, or the pre-commit behaviour is documented; the design choice needs maintainer input first.
由索引模型根據 Issue 內容生成。
描述
Severity: Low · Area: okapi-core OutboxProcessor listener notifications · Found in: code review of main @ e5630a1
Problem
OutboxProcessor.processNext calls listener.onEntryProcessed(...) (Delivered / RetryScheduled / Failed) right after store.updateAfterProcessingBatch, while still inside the scheduler's transaction, before it commits. If the commit then fails (connection loss, serialization failure, server-side timeout), the DB rolls back to PENDING, but okapi.entries.delivered and okapi.entries.failed have already been incremented. The rows are delivered again next tick and counted again.
Metrics therefore over-report successful deliveries in exactly the failure scenarios where operators rely on them. A custom listener that does something non-idempotent (e.g. notifying another system) would act on a state that was never persisted.
Suggested fix
Defer listener callbacks until after the transaction commits: for example, return the processed entries from the transactional block and notify in OutboxScheduler after runInTransaction returns, or register an after-commit hook through TransactionRunner. At minimum, document that events are pre-commit.
- 主要語言
- Kotlin
- 星號
- 14
- 分支
- 0
- 平均合併
- 14 小時 16 分鐘
- 30 天內合併 PR
- 9
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
softwaremill/okapi 的其他 Issue
-
bug
難度 5/5 一週以上 新手友好度 35/100
softwaremill/okapi#141 ·
維護者通常 1 天內回覆
-
enhancement
難度 4/5 1-2 天 新手友好度 42/100
softwaremill/okapi#136 ·
維護者通常 1 天內回覆
-
bug
難度 3/5 半天 新手友好度 62/100
softwaremill/okapi#134 ·
維護者通常 1 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 22/100
softwaremill/okapi#133 ·
維護者通常 1 天內回覆
-
bug critical
難度 3/5 1-2 天 新手友好度 52/100
softwaremill/okapi#132 ·
維護者通常 1 天內回覆
查看 softwaremill/okapi 的全部 Issue
相似的 Issue
-
submit-adaption submit-adaption-pre
難度 1/5 1 小時以內 新手友好度 72/100
BetterAndroid/android-notification-icon-project#848 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 1/5 1-3 小時 新手友好度 70/100
orgzly-revived/orgzly-android-revived#1132 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
commons-app/apps-android-commons#7275 ·
維護者通常 1 天內回覆
-
documentation
難度 2/5 1-3 小時 新手友好度 78/100
liberation-data/drivine4j#682 ·
維護者通常 1 天內回覆
-
documentation good first issue
難度 2/5 1-3 小時 新手友好度 78/100
developmentwithyash/yaan#14 ·
維護者通常 2 天內回覆