You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2025/12/15 19:49:25 UTC

(doris) branch master updated: [chore](thrift)thrift warn when socket is nullptr (#58599)

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

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 1d312cae6f0 [chore](thrift)thrift warn when socket is nullptr (#58599)
1d312cae6f0 is described below

commit 1d312cae6f0f9efd3f05bab407892a2b64a36a64
Author: koarz <66...@users.noreply.github.com>
AuthorDate: Tue Dec 16 03:49:17 2025 +0800

    [chore](thrift)thrift warn when socket is nullptr (#58599)
---
 be/src/util/thrift_client.h | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/be/src/util/thrift_client.h b/be/src/util/thrift_client.h
index e60bc32af72..ccce45f6289 100644
--- a/be/src/util/thrift_client.h
+++ b/be/src/util/thrift_client.h
@@ -62,13 +62,31 @@ public:
     void close();
 
     // Set the connect timeout
-    void set_conn_timeout(int ms) { _socket->setConnTimeout(ms); }
+    void set_conn_timeout(int ms) {
+        if (!_socket) {
+            LOG(WARNING) << "socket is nullptr";
+            return;
+        }
+        _socket->setConnTimeout(ms);
+    }
 
     // Set the receive timeout
-    void set_recv_timeout(int ms) { _socket->setRecvTimeout(ms); }
+    void set_recv_timeout(int ms) {
+        if (!_socket) {
+            LOG(WARNING) << "socket is nullptr";
+            return;
+        }
+        _socket->setRecvTimeout(ms);
+    }
 
     // Set the send timeout
-    void set_send_timeout(int ms) { _socket->setSendTimeout(ms); }
+    void set_send_timeout(int ms) {
+        if (!_socket) {
+            LOG(WARNING) << "socket is nullptr";
+            return;
+        }
+        _socket->setSendTimeout(ms);
+    }
 
 protected:
     ThriftClientImpl(const std::string& ipaddress, int port)


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