mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
Merged in mnesbit-cleanup-correct-shutdown-exceptions (pull request #333)
Fix noisy exceptions in some tests during node stop.
This commit is contained in:
commit
7503ffc10a
@ -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…
Reference in New Issue
Block a user