[ISSUE #7608]✨Drive ProduceAccumulator guards by deadline#7609
Conversation
|
🔊@mxsm 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
|
Caution Review failedPull request was closed or merged during review WalkthroughReplaces periodic tick-based polling in Deadline-driven batch guard scheduling
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7609 +/- ##
==========================================
+ Coverage 69.17% 69.19% +0.01%
==========================================
Files 1234 1234
Lines 268790 269002 +212
==========================================
+ Hits 185944 186138 +194
- Misses 82846 82864 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Which Issue(s) This PR Fixes(Closes)
Brief Description
Replaces the ProduceAccumulator guard fixed-tick full-map scan with deadline-driven scheduling. Each newly created batch registers
key + create_time + deadlinewith the sync or async guard, and each guard maintains a deadline min-heap so it only wakes for the nearest deadline, a new schedule event, or shutdown.The sync guard now notifies waiting sync senders when a batch reaches its deadline. The async guard removes and sends only the due batch after re-checking that the batch is still open and still matches the scheduled
create_time. Batches flushed early by size are handled through lazy deletion when their stale deadline entry is later observed.This also exposes guard wakeup/flush/idle counters through the lifecycle probe and adds a 64-key low-activity benchmark for full-scan vs deadline-heap scheduling.
Latest local guard benchmark data:
Lifecycle benchmark mean: 170.87 us for task-group shutdown.
How Did You Test This Change?
cargo fmt --all- passedcargo test -p rocketmq-client-rust --lib produce_accumulator- passed, 25 testscargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings- passedcargo bench -p rocketmq-client-rust --bench produce_accumulator_guard_lifecycle_bench- passed, latest lifecycle mean 170.87 uscargo bench -p rocketmq-client-rust --bench produce_accumulator_benchmark- passed, guard deadline scheduler improvement 98.31%cargo fmt --allfromrocketmq-example- passedcargo clippy --all-targets -- -D warningsfromrocketmq-example- failed on existing shared-client compile error:ScheduledTaskManager::new_legacy_compatibilityis missing inrocketmq-client/src/factory/mq_client_instance.rscargo fmt --allfromrocketmq-dashboard/rocketmq-dashboard-web/backend- passedcargo clippy --all-targets --all-features -- -D warningsfromrocketmq-dashboard/rocketmq-dashboard-web/backend- passedcargo build --all-targets --all-featuresfromrocketmq-dashboard/rocketmq-dashboard-web/backend- passedcargo fmt --allfromrocketmq-dashboard/rocketmq-dashboard-tauri/src-tauri- passedcargo clippy --all-targets --all-features -- -D warningsfromrocketmq-dashboard/rocketmq-dashboard-tauri/src-tauri- failed on the same existing shared-clientScheduledTaskManager::new_legacy_compatibilitycompile errorSummary by CodeRabbit