From ee0ab43f9c2e126bf3be3fa53e8654c4620fee3f Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Thu, 12 Sep 2019 23:29:20 -0400 Subject: [PATCH] problem: too many timeouts under load or spike in load --- .../io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt index 092140cc..8936c52b 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt @@ -74,7 +74,7 @@ class GrpcUpstreams( val client = ReactorBlockchainGrpc.newReactorStub(channel.build()) this.client = client var i = 0 - val grpcExecutor = Executors.newFixedThreadPool(64) { r -> Thread(r, "grpc-up-$id-${i++}") }; + val grpcExecutor = Executors.newCachedThreadPool { r -> Thread(r, "grpc-up-$id-${i++}") }; this.grpcTransport = EmeraldGrpcTransport.newBuilder() .forChannel(client.channel) .setObjectMapper(objectMapper)