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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 481e411f50e branch-3.0: [Bug](fix) Try to prevent the bug of brpc 
issue 2146 (#47432) #53804 (#53940)
481e411f50e is described below

commit 481e411f50ec5c6ab0c50395bcea07c9c1f693d4
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Aug 14 11:55:11 2025 +0800

    branch-3.0: [Bug](fix) Try to prevent the bug of brpc issue 2146 (#47432) 
#53804 (#53940)
    
    Cherry-picked from #53804
    
    Co-authored-by: HappenLee <[email protected]>
---
 be/src/util/brpc_client_cache.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/be/src/util/brpc_client_cache.h b/be/src/util/brpc_client_cache.h
index 24bd284f302..a8aea36ee0c 100644
--- a/be/src/util/brpc_client_cache.h
+++ b/be/src/util/brpc_client_cache.h
@@ -144,6 +144,8 @@ public:
         } else if (_connection_group != "") {
             options.connection_group = _connection_group;
         }
+        // Add random connection id to connection_group to make sure use new 
socket
+        options.connection_group += 
std::to_string(_connection_id.fetch_add(1));
         options.connect_timeout_ms = 2000;
         options.timeout_ms = 2000;
         options.max_retry = 10;
@@ -227,6 +229,9 @@ private:
     const std::string _protocol;
     const std::string _connection_type;
     const std::string _connection_group;
+    // use to generate unique connection id for each connection
+    // to prevent the connection problem of brpc: 
https://github.com/apache/brpc/issues/2146
+    std::atomic<int64_t> _connection_id {0};
 };
 
 using InternalServiceClientCache = BrpcClientCache<PBackendService_Stub>;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to