You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by kx...@apache.org on 2023/06/09 04:11:00 UTC

[doris] 24/29: [enhancement](heartbeat) print a warning log for long running heartbeat (#20559)

This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit ff68730d3c076fb27de34d409b7e907d76612deb
Author: Yongqiang YANG <98...@users.noreply.github.com>
AuthorDate: Fri Jun 9 08:39:35 2023 +0800

    [enhancement](heartbeat) print a warning log for long running heartbeat (#20559)
---
 be/src/agent/heartbeat_server.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/be/src/agent/heartbeat_server.cpp b/be/src/agent/heartbeat_server.cpp
index 45ad3009f6..d353692c9d 100644
--- a/be/src/agent/heartbeat_server.cpp
+++ b/be/src/agent/heartbeat_server.cpp
@@ -64,6 +64,8 @@ void HeartbeatServer::heartbeat(THeartbeatResult& heartbeat_result,
                           << ", cluster id:" << master_info.cluster_id
                           << ", counter:" << google::COUNTER << ", BE start time: " << _be_epoch;
 
+    MonotonicStopWatch watch;
+    watch.start();
     // do heartbeat
     Status st = _heartbeat(master_info);
     st.to_thrift(&heartbeat_result.status);
@@ -77,6 +79,10 @@ void HeartbeatServer::heartbeat(THeartbeatResult& heartbeat_result,
         heartbeat_result.backend_info.__set_be_start_time(_be_epoch);
         heartbeat_result.backend_info.__set_be_node_role(config::be_node_role);
     }
+    watch.stop();
+    if (watch.elapsed_time() > 1000L * 1000L * 1000L) {
+        LOG(WARNING) << "heartbeat consume too much time. time=" << watch.elapsed_time();
+    }
 }
 
 Status HeartbeatServer::_heartbeat(const TMasterInfo& master_info) {


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