ExposedTransactionRunner: Exposed's default 3x retry re-runs claim+delivery on SQLException, multiplying duplicate deliveries
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 62/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Kotlin
- Star
- 14
- Fork
- 0
- Merge trung bình
- 9 giờ 54 phút
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của softwaremill/okapi
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
softwaremill/okapi#141 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failureCó thể đã có người làm @rawo đã nhận hôm nay. Đang mởbreaking-change bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
softwaremill/okapi#137 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 42/100
softwaremill/okapi#136 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
breaking-change bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
softwaremill/okapi#135 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
softwaremill/okapi#133 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của softwaremill/okapi
Issue tương tự
-
autoteam community connectors/destination/mssql connectors/source/hubspot team/use
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
airbytehq/airbyte#91201 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Source: c7 Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
2.23
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ankidroid/Anki-Android#23042 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Submission] AI通话助手Đang mởsubmit-adaption submit-adaption-pre
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
BetterAndroid/android-notification-icon-project#828 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày