yiguolei commented on code in PR #43212:
URL: https://github.com/apache/doris/pull/43212#discussion_r1827550387


##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -1034,10 +1050,55 @@ void FragmentMgr::cancel_worker() {
                                       "Source frontend is not running or 
restarted"));
         }
 
-    } while 
(!_stop_background_threads_latch.wait_for(std::chrono::seconds(1)));
+    } while (!_stop_background_threads_latch.wait_for(
+            
std::chrono::seconds(config::fragment_mgr_cancel_worker_interval_seconds)));
     LOG(INFO) << "FragmentMgr cancel worker is going to exit.";
 }
 
+void FragmentMgr::_check_brpc_available(const TNetworkAddress& network_address,
+                                        BrpcItem& brpc_item) {
+    const std::string message = "hello doris!";
+    std::string error_message;
+    int32_t failed_count = 0;
+    while (true) {
+        PHandShakeRequest request;
+        request.set_hello(message);
+        PHandShakeResponse response;
+        brpc::Controller cntl;
+        cntl.set_timeout_ms(500);
+        brpc_item.brpc_stub->hand_shake(&cntl, &request, &response, nullptr);
+
+        if (cntl.Failed()) {
+            error_message = cntl.ErrorText();
+            LOG(WARNING) << "brpc stub: " << network_address << " check 
failed: " << error_message;
+        } else if (response.has_status() && response.has_hello() && 
response.hello() == message &&

Review Comment:
   Do not need check response value.
   If has response, it means we could connect dest succesfully, then the 
connection is OK.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to