-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[GrpcClient] The thread name may be incorrect after reconect to the next server #9954
Comments
描述 可能存在问题 代码片段 static final long DEFAULT_GRPC_KEEP_ALIVE_TIME = GrpcUtil.DEFAULT_SERVER_KEEPALIVE_TIME_NANOS;
static final long DEFAULT_GRPC_KEEP_ALIVE_TIMEOUT = GrpcUtil.DEFAULT_SERVER_KEEPALIVE_TIMEOUT_NANOS;
static final long DEFAULT_GRPC_PERMIT_KEEP_ALIVE_TIME = TimeUnit.MINUTES.toNanos(5L); 类 @Override
public void startServer() throws Exception {
final MutableHandlerRegistry handlerRegistry = new MutableHandlerRegistry();
addServices(handlerRegistry, new GrpcConnectionInterceptor());
server = ServerBuilder.forPort(getServicePort()).executor(getRpcExecutor())
.maxInboundMessageSize(getMaxInboundMessageSize()).fallbackHandlerRegistry(handlerRegistry)
.compressorRegistry(CompressorRegistry.getDefaultInstance())
.decompressorRegistry(DecompressorRegistry.getDefaultInstance())
.addTransportFilter(new AddressTransportFilter(connectionManager))
.keepAliveTime(getKeepAliveTime(), TimeUnit.MILLISECONDS) // here
.keepAliveTimeout(getKeepAliveTimeout(), TimeUnit.MILLISECONDS) // here
.permitKeepAliveTime(getPermitKeepAliveTime(), TimeUnit.MILLISECONDS) // here
.build();
server.start();
} |
对于上面的议题,是否可以通过如下来解决: |
Q1 可能是为了方便排查,需要讨论下是否修改。 |
@pixystone 老师,您的看法呢 |
这里名称主要是为了方便Server节点之间通信的client方便排查问题,因为他们IP不会变。
|
|
描述
目前develop分支中
GrpcClient#createGrpcExecutor
在创建线程池grpcExecutor时,可以传入serverIp当作线程名的一部分;当GRPC客户端发生reconect时选取下一个地址时grpcExecutor不会再次初始化,所以线程名没有变,实际上serverIp可能已经变了。可能存在问题
由于实际serverIp已经变了,线程名上的serverIp还体现了第一次连接的地址上。
代码片段
The text was updated successfully, but these errors were encountered: