Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement](rpc) set grpc channel's keepAliveTime and remove proxy on InterruptedExcep… #37304

Merged
merged 9 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,12 @@ 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
*/
@ConfField
BiteTheDDDDt marked this conversation as resolved.
Show resolved Hide resolved
public static int grpc_keep_alive_second = 10;

/**
* Used to set minimal number of replication per tablet.
*/
Expand Down
2 changes: 2 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
Original file line number Diff line number Diff line change
Expand Up @@ -950,13 +950,15 @@ private void waitPipelineRpc(List<Triple<PipelineExecContexts, BackendServicePro
} catch (InterruptedException e) {
exception = e;
code = TStatusCode.INTERNAL_ERROR;
triple.getMiddle().removeProxy(triple.getLeft().brpcAddr);
} catch (TimeoutException e) {
exception = e;
errMsg = String.format(
"timeout when waiting for %s rpc, query timeout:%d, left timeout for this operation:%d",
operation, queryOptions.getExecutionTimeout(), timeoutMs / 1000);
LOG.warn("Query {} {}", DebugUtil.printId(queryId), errMsg);
code = TStatusCode.TIMEOUT;
triple.getMiddle().removeProxy(triple.getLeft().brpcAddr);
}

if (code != TStatusCode.OK) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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)
Expand Down
Loading