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

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


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

commit 4579c3800edbf34ca7018fbb0069595436d94a77
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jul 28 10:35:55 2025 +0800

    branch-3.1: [Bug](fix) Try to prevent the bug of brpc issue 2146 (#47432) 
#53804 (#53941)
    
    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 58d544dd5a9..facd3ffab94 100644
--- a/be/src/util/brpc_client_cache.h
+++ b/be/src/util/brpc_client_cache.h
@@ -227,6 +227,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;
@@ -310,6 +312,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