Merge remote-tracking branch 'remotes/open/master' into feature/vkolomeyko/os-merge

# Conflicts:
#	node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/SharedContexts.kt
#	node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt
#	tools/explorer/src/main/kotlin/net/corda/explorer/views/SearchField.kt
#	tools/explorer/src/main/kotlin/net/corda/explorer/views/TransactionViewer.kt
This commit is contained in:
Viktor Kolomeyko
2018-05-10 15:36:07 +01:00
27 changed files with 328 additions and 118 deletions

View File

@ -371,7 +371,15 @@ class RPCClientProxyHandler(
interrupt()
join(1000)
}
sessionFactory?.close()
if (notify) {
// This is going to send remote message, see `org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.doCleanUp()`.
sessionFactory?.close()
} else {
// This performs a cheaper and faster version of local cleanup.
sessionFactory?.cleanup()
}
reaperScheduledFuture?.cancel(false)
observableContext.observableMap.invalidateAll()
reapObservables(notify)
@ -528,7 +536,11 @@ class RPCClientProxyHandler(
val m = observableContext.observableMap.asMap()
m.keys.forEach { k ->
observationExecutorPool.run(k) {
m[k]?.onError(RPCException("Connection failure detected."))
try {
m[k]?.onError(RPCException("Connection failure detected."))
} catch (th: Throwable) {
log.error("Unexpected exception when RPC connection failure handling", th)
}
}
}
observableContext.observableMap.invalidateAll()