From c964e50696a9bfe4ea2c229d1d04f7e5d38c99f3 Mon Sep 17 00:00:00 2001 From: Viktor Kolomeyko Date: Mon, 19 Mar 2018 13:19:40 +0000 Subject: [PATCH] Trying to improve stability of `RPCStabilityTests.client reconnects to rebooted server` (#2842) Prior to this change it was intermittently failing with: ``` net.corda.client.rpc.RPCException: RPC server is not available. at net.corda.client.rpc.internal.RPCClientProxyHandler.invoke(RPCClientProxyHandler.kt:222) at com.sun.proxy.$Proxy79.ping(Unknown Source) at net.corda.client.rpc.RPCStabilityTests$client reconnects to rebooted server$1$pingFuture$1.invoke(RPCStabilityTests.kt:251) at net.corda.client.rpc.RPCStabilityTests$client reconnects to rebooted server$1$pingFuture$1.invoke(RPCStabilityTests.kt:36) at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:107) at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt:65535) at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:119) at net.corda.core.internal.concurrent.CordaFutureImplKt$fork$$inlined$also$lambda$1.run(CordaFutureImpl.kt:22) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) ``` --- .../net/corda/client/rpc/internal/RPCClientProxyHandler.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt index 6964fe493d..56e472d107 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt @@ -173,6 +173,7 @@ class RPCClientProxyHandler( private val deduplicationSequenceNumber = AtomicLong(0) private val lock = ReentrantReadWriteLock() + @Volatile private var sendingEnabled = true /**