mirror of
https://github.com/corda/corda.git
synced 2025-04-14 14:37:22 +00:00
Address comments #665
This commit is contained in:
parent
8a17406246
commit
b192a86a30
client/rpc/src
integration-test/kotlin/net/corda/client/rpc
main/kotlin/net/corda/client/rpc/internal
core/src/main/kotlin/net/corda/core/utilities
node/src/main/kotlin/net/corda/node/services/messaging
@ -46,7 +46,7 @@ class RPCStabilityTests {
|
||||
values.poll()
|
||||
}
|
||||
val first = values.peek()
|
||||
if (values.size == 5 && values.all { it == first } ) {
|
||||
if (values.size == 5 && values.all { it == first }) {
|
||||
first
|
||||
} else {
|
||||
null
|
||||
@ -63,11 +63,11 @@ class RPCStabilityTests {
|
||||
startRpcClient<RPCOps>(server.get().hostAndPort).get()
|
||||
}
|
||||
}
|
||||
for (i in 1 .. 5) {
|
||||
repeat(5) {
|
||||
startAndStop()
|
||||
}
|
||||
val numberOfThreadsBefore = waitUntilNumberOfThreadsStable(executor)
|
||||
for (i in 1 .. 5) {
|
||||
repeat(5) {
|
||||
startAndStop()
|
||||
}
|
||||
val numberOfThreadsAfter = waitUntilNumberOfThreadsStable(executor)
|
||||
@ -87,11 +87,11 @@ class RPCStabilityTests {
|
||||
ErrorOr.catch { startRpcClient<RPCOps>(server.get().hostAndPort, configuration = RPCClientConfiguration.default.copy(minimumServerProtocolVersion = 1)).get() }
|
||||
}
|
||||
}
|
||||
for (i in 1 .. 5) {
|
||||
repeat(5) {
|
||||
startAndStop()
|
||||
}
|
||||
val numberOfThreadsBefore = waitUntilNumberOfThreadsStable(executor)
|
||||
for (i in 1 .. 5) {
|
||||
repeat(5) {
|
||||
startAndStop()
|
||||
}
|
||||
val numberOfThreadsAfter = waitUntilNumberOfThreadsStable(executor)
|
||||
|
@ -281,7 +281,7 @@ class RPCClientProxyHandler(
|
||||
// leak borrowed executors.
|
||||
val observationExecutors = observationExecutorPool.close()
|
||||
observationExecutors.forEach { it.shutdownNow() }
|
||||
lifeCycle.transition(State.FINISHED)
|
||||
lifeCycle.justTransition(State.FINISHED)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ class LifeCycle<S : Enum<S>>(initial: S) {
|
||||
}
|
||||
|
||||
/** Transition the state to [to] without performing a current state check. */
|
||||
fun transition(to: S) {
|
||||
fun justTransition(to: S) {
|
||||
lock.writeLock().withLock {
|
||||
state = to
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ class RPCServer(
|
||||
it.session.close()
|
||||
it.sessionFactory.close()
|
||||
}
|
||||
lifeCycle.transition(State.FINISHED)
|
||||
lifeCycle.justTransition(State.FINISHED)
|
||||
}
|
||||
|
||||
private fun bindingRemovalArtemisMessageHandler(artemisMessage: ClientMessage) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user