Closed mxsm closed 2 months ago
In this update, the initialization of PullMessageProcessor
was optimized, and various improvements were made to the rocketmq-broker
and rocketmq-store
codebases. Enhancements include safer handling of message pulling with SyncUnsafeCell
, improved shutdown logic using tokio::Notify
, and better structured logging and request handling.
File/Module | Change Summary |
---|---|
rocketmq-broker/.../broker_runtime.rs |
Switched to using SyncUnsafeCell for thread-safe initialization of the pull message result handler and modified the pull request hold service assignment. |
rocketmq-broker/.../long_polling/.../pull_request_hold_service.rs |
Updated to include a shutdown signal mechanism using Arc<Notify> , added shutdown method, refactored request handling, and added logging. |
rocketmq-broker/.../processor/default_pull_message_result_handler.rs |
Added imports for necessary services, modified struct to include pull request hold service, added setter method, and refactored the handle method for enhanced logging and request suspension logic. |
rocketmq-broker/.../processor/pull_message_processor.rs |
Updated the type of pull_message_result_handler to Arc<SyncUnsafeCell<dyn PullMessageResultHandler>> and added request logging in process_request function. |
rocketmq-store/.../single_consume_queue.rs |
Updated get_unit_size function to return the correct CQ_STORE_UNIT_SIZE instead of a placeholder. |
N/A
Objective | Addressed | Explanation |
---|---|---|
Optimize PullMessageProcessor initialization (#737) |
✅ |
In files where RocketMQ resides,
A safer cell now guards the tides,
With logging bright and shutdown tight,
It processes requests 'til the night.
From stores of queues to message's end,
Improvements flow, like code we send.
Cheers to changes, swift and clean,
In Rabbit's world, a perfect scene.
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?
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
Attention: Patch coverage is 0%
with 43 lines
in your changes missing coverage. Please review.
Project coverage is 27.88%. Comparing base (
d829bf6
) to head (7835072
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Which Issue(s) This PR Fixes(Closes)
Fixes #737
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
PullRequestHoldService
with a new shutdown notification mechanism.Refactor
Bug Fixes
Performance Improvements