Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -1464,6 +1464,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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1199,13 +1199,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