feat: cancellable OutboxDrainRunner - #203
Conversation
Immediate after-commit publish stays the fast path. This loop is the safety net: dispatch_batch until the outbox is empty, sleep when idle, back off on store errors, stop on abort. Worker id is drain:<pid> so claims never collide with microsvc-immediate:<pid>. Service::outbox_drain builds the runner; spawn_outbox_publish_loop now wraps it. Dropping the handle leaves the task running; stop() aborts. Implements [[tasks/outbox-background-drain-runner]]
|
Warning Review limit reached
Next review available in: 52 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds the missing background outbox drain loop. Immediate after-commit publish stays the fast path; this runner is the crash/retry safety net.
OutboxDrainRunneroverOutboxDispatcher::dispatch_batch— full batches continue immediately, empty passes sleep, store errors back off and do not kill the taskdrain:<pid>so claims never collide withmicrosvc-immediate:<pid>Service::outbox_drainbuilds a runner (does not spawn).run()stays no-timerspawn_outbox_publish_loopnow wraps the runner; dropping the handle leaves the task running (e2e-ui fire-and-forget)stop()aborts promptlyTests:
stop()returns in <500ms during a 30s idle sleepService::outbox_drainsugar publishes leftover rowsImplements [[tasks/outbox-background-drain-runner]]
Independent of #202 (load suite). This branch is from
main.Test plan
cargo test --lib outbox_worker::draincargo test --lib outbox_drain_sugarcargo test --lib outbox_worker::outbox_dispatch