problem: grpc upstream timeouts
solution: tune connection settings
This commit is contained in:
@@ -57,6 +57,8 @@ class GrpcUpstreams(
|
|||||||
val channel: ManagedChannelBuilder<*> = if (auth != null && StringUtils.isNotEmpty(auth.ca)) {
|
val channel: ManagedChannelBuilder<*> = if (auth != null && StringUtils.isNotEmpty(auth.ca)) {
|
||||||
NettyChannelBuilder.forAddress(host, port)
|
NettyChannelBuilder.forAddress(host, port)
|
||||||
.useTransportSecurity()
|
.useTransportSecurity()
|
||||||
|
.enableRetry()
|
||||||
|
.maxRetryAttempts(3)
|
||||||
.sslContext(withTls(auth))
|
.sslContext(withTls(auth))
|
||||||
} else {
|
} else {
|
||||||
log.warn("Using insecure connection to $host:$port")
|
log.warn("Using insecure connection to $host:$port")
|
||||||
@@ -67,7 +69,7 @@ class GrpcUpstreams(
|
|||||||
val client = ReactorBlockchainGrpc.newReactorStub(channel.build())
|
val client = ReactorBlockchainGrpc.newReactorStub(channel.build())
|
||||||
this.client = client
|
this.client = client
|
||||||
var i = 0
|
var i = 0
|
||||||
val grpcExecutor = Executors.newFixedThreadPool(32) { r -> Thread(r, "grpc-up-$id-${i++}") };
|
val grpcExecutor = Executors.newFixedThreadPool(64) { r -> Thread(r, "grpc-up-$id-${i++}") };
|
||||||
this.grpcTransport = EmeraldGrpcTransport.newBuilder()
|
this.grpcTransport = EmeraldGrpcTransport.newBuilder()
|
||||||
.forChannel(client.channel)
|
.forChannel(client.channel)
|
||||||
.setObjectMapper(objectMapper)
|
.setObjectMapper(objectMapper)
|
||||||
|
|||||||
Reference in New Issue
Block a user