[ISSUE #2857]♻️Refactor PutResultProcess#2858
Conversation
WalkthroughThe changes refactor the Changes
Sequence Diagram(s)sequenceDiagram
participant Broker
participant PutResultProcess
Broker->>PutResultProcess: sync_deliver()
Note right of PutResultProcess: get() returns result synchronously
PutResultProcess-->>Broker: Return PutMessageResult
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (9)
🔇 Additional comments (5)
✨ 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. 🪧 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💥. |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the PutResultProcess to eliminate the asynchronous oneshot channel mechanism in favor of a synchronous result handling approach. Key changes include the removal of the oneshot channel, renaming the setter from set_future to set_put_message_result, and changing the get() method from an async to a synchronous call.
Comments suppressed due to low confidence (2)
rocketmq-broker/src/schedule/schedule_message_service.rs:1179
- Changing get() from asynchronous to synchronous may cause issues if put_message_result is accessed before it is set. Consider ensuring that the result is reliably set before calling get() or documenting the timing assumptions clearly.
pub fn get(&mut self) -> PutMessageResult {
rocketmq-broker/src/schedule/schedule_message_service.rs:966
- [nitpick] The new method name set_put_message_result clearly reflects its functionality. It would be beneficial to update the method documentation to mention that it replaces the previous asynchronous future mechanism.
pub fn set_put_message_result(mut self, put_result: PutMessageResult) -> Self {
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2858 +/- ##
=======================================
Coverage 27.55% 27.55%
=======================================
Files 527 527
Lines 78054 78048 -6
=======================================
Hits 21504 21504
+ Misses 56550 56544 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Which Issue(s) This PR Fixes(Closes)
Fixes #2857
Brief Description
How Did You Test This Change?
Summary by CodeRabbit