Skip to content

Commit

Permalink
[ISSUE #2170]🐛Fix BatchUnregistrationService not started when Name se…
Browse files Browse the repository at this point in the history
…rver start (#2171)
  • Loading branch information
mxsm authored Jan 8, 2025
1 parent 8a782cf commit 1db0079
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rocketmq-namesrv/src/route/batch_unregistration_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
use rocketmq_remoting::protocol::header::namesrv::broker_request::UnRegisterBrokerRequestHeader;
use rocketmq_rust::ArcMut;
use tracing::info;
use tracing::warn;

use crate::bootstrap::NameServerRuntimeInner;
Expand Down Expand Up @@ -53,6 +54,7 @@ impl BatchUnregistrationService {
let mut rx = self.rx.take().expect("rx is None");
let limit = 10;
tokio::spawn(async move {
info!(">>>>>>>>BatchUnregistrationService started<<<<<<<<<<<<<<<<<<<");
loop {
let mut unregistration_requests = Vec::with_capacity(limit);
tokio::select! {
Expand Down
1 change: 1 addition & 0 deletions rocketmq-namesrv/src/route/route_info_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ impl RouteInfoManager {
//! start client connection disconnected listener
pub fn start(&self, receiver: broadcast::Receiver<SocketAddr>) {
let mut inner = self.name_server_runtime_inner.clone();
self.un_register_service.mut_from_ref().start();
let mut receiver = receiver;
tokio::spawn(async move {
while let Ok(socket_addr) = receiver.recv().await {
Expand Down

0 comments on commit 1db0079

Please sign in to comment.