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

lihaopeng 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 06c6bfd7c8b [Bug](fix) Try to prevent the bug of brpc issue 2146 
(#47432) (#53804)
06c6bfd7c8b is described below

commit 06c6bfd7c8b8829ca972777478e6312e37017860
Author: HappenLee <[email protected]>
AuthorDate: Sun Jul 27 13:22:57 2025 +0800

    [Bug](fix) Try to prevent the bug of brpc issue 2146 (#47432) (#53804)
    
    add connection group try to fix brpc issue 2146
---
 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