Closed mxsm closed 3 months ago
The changes introduce asynchronous programming to various parts of the RocketMQ codebase. Functions related to scheduled tasks, name server address updates, and client operations have been modified to be asynchronous, improving efficiency and responsiveness. Error handling has been enhanced to better manage potential issues during broker registration and client operations.
Files & Paths | Change Summary |
---|---|
rocketmq-broker/src/broker_runtime.rs |
Converted initialize_scheduled_tasks and update_namesrv_addr to async functions. |
rocketmq-broker/src/out_api/broker_outer_api.rs |
Converted update_name_server_address_list and update_name_server_address_list_by_dns_lookup to async functions; enhanced error handling in register_broker_all . |
rocketmq-remoting/src/clients.rs |
Replaced synchronous update_name_server_address_list with async; updated return type handling for send_async . |
rocketmq-remoting/src/clients/client.rs |
Refactored connect and send methods to handle timeouts and errors; added connection and connection_mut methods. |
rocketmq-remoting/src/clients/rocketmq_default_impl.rs |
Transitioned various methods to async; replaced parking_lot::Mutex with tokio::sync::Mutex ; introduced new fields in RocketmqDefaultClient . |
rocketmq-remoting/src/connection.rs |
Added framed and ok fields to Connection ; removed channel method. |
sequenceDiagram
participant Client
participant Server
participant NamesrvAddr
Client->>Server: register_broker_all()
Server-->>Client: Response/Error
Client->>NamesrvAddr: update_name_server_address_list()
NamesrvAddr-->>Client: Address List
Client->>Server: update_namesrv_addr()
Server-->>Client: ACK
Objective (Issue #805) | Addressed | Explanation |
---|---|---|
Refactor broker registration to handle errors gracefully | ✅ | |
Transition functions to asynchronous execution | ✅ | |
Improve error handling in client operations | ✅ | |
Modify name server address updates to be asynchronous | ✅ |
In the world of bytes and code,
Asynchronous winds have blown,
The broker's tasks now light and bold,
Errors handled, confidence grown.
With updates swift and seamless flow,
RocketMQ's brilliance now aglow.
🚀✨
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🔥
Which Issue(s) This PR Fixes(Closes)
Fixes #805
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
Refactor
parking_lot::Mutex
withMutex
for better synchronization.Bug Fixes
send
andread
methods to better manage connection failures.Chores