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 368bfdb5d80 [fix](cloud) fix incorrect timeout of FE connection pool
(#41202)
368bfdb5d80 is described below
commit 368bfdb5d801c5bea5cc8b645bd2fa80b8e811a6
Author: Luwei <[email protected]>
AuthorDate: Wed Sep 25 11:19:14 2024 +0800
[fix](cloud) fix incorrect timeout of FE connection pool (#41202)
---
.../src/main/java/org/apache/doris/cloud/rpc/MetaServiceClient.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceClient.java
b/fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceClient.java
index 47108b147f5..323b880a3a7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceClient.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceClient.java
@@ -33,6 +33,7 @@ import org.apache.logging.log4j.Logger;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Map;
+import java.util.Random;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -45,6 +46,7 @@ public class MetaServiceClient {
private final ManagedChannel channel;
private final long expiredAt;
private final boolean isMetaServiceEndpointList;
+ private Random random = new Random();
static {
NameResolverRegistry.getDefaultRegistry().register(new
MetaServiceListResolverProvider());
@@ -76,7 +78,9 @@ public class MetaServiceClient {
// Disable connection age if the endpoint is a list.
if (!isMetaServiceEndpointList && connectionAgeBase > 1) {
long base = TimeUnit.MINUTES.toMillis(connectionAgeBase);
- return base + System.currentTimeMillis() % base;
+ long now = System.currentTimeMillis();
+ long rand = random.nextLong(base);
+ return now + base + rand;
}
return Long.MAX_VALUE;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]