This is an automated email from the ASF dual-hosted git repository.
panxiaolei pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 71c7c7733fd [Improvement](rpc) set grpc channel's keepAliveTime and
remove proxy … (#38380)
71c7c7733fd is described below
commit 71c7c7733fdf8a655b826d65757aaec8f3a6a2e5
Author: Pxl <[email protected]>
AuthorDate: Fri Jul 26 09:50:48 2024 +0800
[Improvement](rpc) set grpc channel's keepAliveTime and remove proxy …
(#38380)
…on InterruptedExcep… (#37304)
## Proposed changes
1. set grpc channel's keepAliveTime
2. remove proxy on InterruptedException/TimeoutException to avoid
channel unavailable
pick from #37304
## Proposed changes
Issue Number: close #xxx
<!--Describe your changes.-->
---
fe/fe-common/src/main/java/org/apache/doris/common/Config.java | 8 ++++++++
fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java | 2 ++
.../src/main/java/org/apache/doris/rpc/BackendServiceClient.java | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
index e7c5fdcdbf1..57b6cf0e2eb 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@@ -1422,6 +1422,14 @@ public class Config extends ConfigBase {
@ConfField
public static int grpc_threadmgr_threads_nums = 4096;
+ /**
+ * sets the time without read activity before sending a keepalive ping
+ * the smaller the value, the sooner the channel is unavailable, but it
will increase network io
+ */
+ @ConfField(description = { "设置grpc连接发送 keepalive ping 之前没有数据传输的时间。",
+ "The time without grpc read activity before sending a keepalive
ping" })
+ public static int grpc_keep_alive_second = 10;
+
/**
* Used to set minimal number of replication per tablet.
*/
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
index e50bf77650d..c6c6cd2cc3c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
@@ -1001,6 +1001,7 @@ public class Coordinator implements CoordInterface {
} catch (InterruptedException e) {
exception = e;
code = TStatusCode.INTERNAL_ERROR;
+ triple.getMiddle().removeProxy(triple.getLeft().brpcAddr);
} catch (TimeoutException e) {
exception = e;
errMsg = String.format(
@@ -1008,6 +1009,7 @@ public class Coordinator implements CoordInterface {
operation,
queryOptions.getExecutionTimeout(), timeoutMs / 1000);
LOG.warn("Query {} {}", DebugUtil.printId(queryId), errMsg);
code = TStatusCode.TIMEOUT;
+ triple.getMiddle().removeProxy(triple.getLeft().brpcAddr);
}
try {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java
b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java
index 9ef0f7ce118..657c06bbe1d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java
@@ -54,7 +54,7 @@ public class BackendServiceClient {
public BackendServiceClient(TNetworkAddress address, Executor executor) {
this.address = address;
channel = NettyChannelBuilder.forAddress(address.getHostname(),
address.getPort())
- .executor(executor)
+
.executor(executor).keepAliveTime(Config.grpc_keep_alive_second,
TimeUnit.SECONDS)
.flowControlWindow(Config.grpc_max_message_size_bytes)
.keepAliveWithoutCalls(true)
.maxInboundMessageSize(Config.grpc_max_message_size_bytes).enableRetry().maxRetryAttempts(MAX_RETRY_NUM)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]