-
Notifications
You must be signed in to change notification settings - Fork 216
[ISSUE #5335]✨Improve pull_request_hold_service accessor to return Option<&T> in BrokerRuntimeInner #5459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…n Option<&T> in BrokerRuntimeInner
|
🔊@WaterWhisperer 🚀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💥. |
WalkthroughThis PR improves the API design of the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @rocketmq-broker/src/broker_runtime.rs:
- Around line 1812-1814: The new pull_request_hold_service method now returns
Option<&PullRequestHoldService<MS>>, so remove redundant
.as_ref()/.as_ref().unwrap() call chains at the listed call sites and use direct
pattern matching or Option handling instead; update
notify_message_arriving_listener.rs (lines ~54-56), pull_request_hold_service.rs
(around lines ~76 and ~82), and default_pull_message_result_handler.rs (around
lines ~248-250) to mirror notify_min_broker_id_handler.rs by using if let
Some(svc) = self.broker.pull_request_hold_service() (or match) and then use svc
directly, avoiding unwraps and preserving borrow semantics.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rocketmq-broker/src/broker_runtime.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-10T06:20:00.401Z
Learnt from: 578223592
Repo: mxsm/rocketmq-rust PR: 3240
File: rocketmq-namesrv/src/kvconfig/kvconfig_mananger.rs:69-71
Timestamp: 2025-05-10T06:20:00.401Z
Learning: In RocketMQ Rust, while dashmap is concurrent-safe, returning a direct reference to a DashMap can break encapsulation by allowing external code to modify the map without triggering persistence methods like `persist()`. Consider returning a read-only view, iterator methods, or a snapshot instead.
Applied to files:
rocketmq-broker/src/broker_runtime.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Check (fmt + clippy)
- GitHub Check: auto-approve
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5459 +/- ##
=======================================
Coverage 38.19% 38.19%
=======================================
Files 813 813
Lines 110210 110210
=======================================
Hits 42097 42097
Misses 68113 68113 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rocketmq-rust-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - All CI checks passed ✅
Which Issue(s) This PR Fixes(Closes)
Fixes #5335
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.