-
Notifications
You must be signed in to change notification settings - Fork 143
[ISSUE #2111]🏗️BrokerInner add mut methods⚡️ #2112
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
WalkthroughThis pull request introduces a comprehensive set of mutable accessor methods for the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
🔊@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💥. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2112 +/- ##
==========================================
- Coverage 28.05% 28.01% -0.05%
==========================================
Files 493 493
Lines 70722 70831 +109
==========================================
Hits 19843 19843
- Misses 50879 50988 +109 ☔ View full report in Codecov by Sentry. |
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: 0
🧹 Nitpick comments (4)
rocketmq-broker/src/broker_runtime.rs (4)
192-195
: Encourage Rust doc comments
Adding///
doc comments describing the purpose and usage of this function can improve maintainability.
202-205
: No immediate issues; missing doc comments
Implementation is correct. Consider adding doc comments to guide usage.
212-215
: Maintain consistent doc comments
Keep function documentation consistent across all newly added mutable getters.
227-230
: Expand usage instructions
Ifconsumer_filter_manager
is used concurrently, consider an explanatory doc comment about concurrency.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rocketmq-broker/src/broker_runtime.rs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: build (windows-latest, nightly)
- GitHub Check: build (windows-latest, stable)
- GitHub Check: build (macos-latest, nightly)
- GitHub Check: build (macos-latest, stable)
- GitHub Check: build (ubuntu-latest, nightly)
- GitHub Check: test
- GitHub Check: build
- GitHub Check: build (ubuntu-latest, stable)
- GitHub Check: auto-approve
🔇 Additional comments (29)
rocketmq-broker/src/broker_runtime.rs (29)
187-190
: Consider concurrency safety for direct mutable references
Returning a mutable reference is straightforward. However, be mindful of concurrent access in multi-threaded scenarios. Ensure theBrokerInner<MS>
is not shared across threads without proper synchronization.
197-200
: Consistent naming and behavior
The method name_mut
is consistent with the other newly introduced mutable accessors. No functional issues noted.
207-210
: Good use of #[inline]
This function is trivial and inlining can be beneficial. No issues found.
217-220
: Thread safety caution
Exposing a mutable reference toconsumer_offset_manager
is valid, but ensure concurrency constraints are clearly documented or enforced in higher layers.
222-225
: No issues
Granting mutable access to thesubscription_group_manager
is straightforward. No concerns raised.
232-235
: Nothing problematic
Method logic is correct for returning a mutable handle toconsumer_order_info_manager
.
237-240
: Option wrapping
Ensure callers handle theNone
case properly when attempting mutable access onmessage_store
.
242-245
: Proper usage of Option
Likewise, confirm that the potentialNone
inbroker_stats
is safely handled.
247-250
: Schedule message service mutation
Straightforward direct reference. No immediate issues.
252-255
: Check for timer feature toggles
Returning a mutable reference totimer_message_store
is fine; ensure the feature gating or usage fortimer_message_store
is consistent.
257-260
: No issues
Implementation is concise and consistent with other getters.
262-265
: Producer manager mut
Approach is consistent with the rest of the accessors. No concerns.
267-270
: No concerns
This mutable accessor forconsumer_manager
follows the established pattern.
272-275
: Nothing special
Implementation is correct. Ensure concurrency is handled in upstream usage.
277-280
: Check usage
This allows mutatingbroker_stats_manager
; ensure you do not introduce data races or partial updates.
282-287
: Option return
Proceed with caution if theTopicQueueMappingCleanService
field isNone
. Implementation is otherwise correct.
289-292
: Boolean mutation
No issues, but be mindful of concurrency if multiple threads are toggling this.
294-297
: Atomic usage
The function returns a mutable reference to an atomic type. Typically, we mutate anAtomicU64
via inherent methods (e.g.,fetch_add
). Exposing a full mutable reference is unusual but not incorrect.
299-302
: Similarly foris_isolated
Returning&mut AtomicBool
deviates from normal usage ofAtomicBool
methods. Confirm that external code usage is safe.
304-307
: Retrieving Option
Check forNone
usage at call sites.
309-312
: Straightforward
No issues noted forrebalance_lock_manager_mut
.
314-317
: BrokerMemberGroup mutation
No concerns. The approach is consistent with other methods.
319-324
: Feature gating
The returned service is optional. Ensure gating remains consistent.
326-331
: Check usage
Ensure the code handles the possibility of missingtransactional_message_check_listener
.
333-338
: Transactional message check
Again, watch forNone
values on access.
340-345
: TransactionMetricsFlushService
No direct concerns. Keep concurrency considerations in mind if this is mutated in multiple threads.
347-350
: TopicRouteInfoManager
No issues. Straight access to an Arc-managed field.
352-355
: EscapeBridge
Implementation is matched; ensure no unguarded concurrency usage.
357-360
: PopInflightMessageCounter
Implementation is straightforward. Confirm concurrency constraints.
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
Which Issue(s) This PR Fixes(Closes)
Fixes #2111
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
BrokerInner
struct