[CORDA-2923] Revert previous test fix and workaround other test failures (#5319)

* Revert "[CORDA-2923] Prevent connection threads leaking on reconnect (#5313)"

This reverts commit a204b50f5b.

* [CORDA-2923] Move CordaRPCClientReconnectionTest to prevent test failures
This commit is contained in:
James Higgs 2019-07-23 09:05:56 +01:00 committed by Rick Parker
parent 4e66885cf9
commit 5736a8e09f
3 changed files with 8 additions and 7 deletions

View File

@ -91,10 +91,10 @@ class RPCStabilityTests {
block()
}
val threadsAfter = waitUntilNumberOfThreadsStable(executor)
val newThreads = threadsAfter.keys.minus(threadsBefore.keys)
require(newThreads.isEmpty()) {
"Threads have leaked. New threads created: $newThreads (total before: ${threadsBefore.size}, total after: ${threadsAfter.size})"
}
// This is a less than check because threads from other tests may be shutting down while this test is running.
// This is therefore a "best effort" check. When this test is run on its own this should be a strict equality.
// In case of failure we output the threads along with their stacktraces to get an idea what was running at a time.
require(threadsBefore.keys.size >= threadsAfter.keys.size) { "threadsBefore: $threadsBefore\nthreadsAfter: $threadsAfter" }
} finally {
executor.shutdownNow()
}

View File

@ -1,5 +1,8 @@
package net.corda.client.rpc
package net.corda.client.rpcreconnect
import net.corda.client.rpc.CordaRPCClient
import net.corda.client.rpc.CordaRPCClientConfiguration
import net.corda.client.rpc.CordaRPCClientTest
import net.corda.client.rpc.internal.ReconnectingCordaRPCOps
import net.corda.core.messaging.startTrackedFlow
import net.corda.core.utilities.NetworkHostAndPort

View File

@ -157,8 +157,6 @@ class ReconnectingCordaRPCOps private constructor(
*/
@Synchronized
fun reconnectOnError(e: Throwable) {
// Ensure any resources on this side are cleaned up before building a new connection
currentRPCConnection?.close()
currentState = CurrentState.DIED
//TODO - handle error cases
log.error("Reconnecting to ${this.nodeHostAndPorts} due to error: ${e.message}")