mirror of
https://github.com/corda/corda.git
synced 2025-02-01 00:45:59 +00:00
My recent PR#325 contained a couple of mistakes. In particular on Unix, but not windows the shutdown hook unregister can give a non-fatal exception during some tests. Also, I got the point of client messaging service stop registration wrong, which was leading to the server shutting down teh client session ahead of the proper stop sequence.
This commit is contained in:
parent
63e2ec32cf
commit
58aa933307
@ -168,7 +168,6 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
|
||||
checkpointStorage = storageServices.second
|
||||
netMapCache = InMemoryNetworkMapCache()
|
||||
net = makeMessagingService()
|
||||
runOnStop += Runnable { net.stop() }
|
||||
wallet = makeWalletService()
|
||||
|
||||
identity = makeIdentityService()
|
||||
@ -211,6 +210,7 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
|
||||
ScheduledActivityObserver(services)
|
||||
|
||||
startMessagingService()
|
||||
runOnStop += Runnable { net.stop() }
|
||||
_networkMapRegistrationFuture.setFuture(registerWithNetworkMap())
|
||||
isPreviousCheckpointsPresent = checkpointStorage.checkpoints.any()
|
||||
smm.start()
|
||||
|
@ -281,7 +281,7 @@ class Node(dir: Path, val p2pAddr: HostAndPort, val webServerAddr: HostAndPort,
|
||||
shutdown = true
|
||||
|
||||
// Unregister shutdown hook to prevent any unnecessary second calls to stop
|
||||
if(shutdownThread != null) {
|
||||
if((shutdownThread != null) && (Thread.currentThread() != shutdownThread)){
|
||||
Runtime.getRuntime().removeShutdownHook(shutdownThread)
|
||||
shutdownThread = null
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user