mirror of
https://github.com/corda/corda.git
synced 2025-01-31 08:25:50 +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
|
checkpointStorage = storageServices.second
|
||||||
netMapCache = InMemoryNetworkMapCache()
|
netMapCache = InMemoryNetworkMapCache()
|
||||||
net = makeMessagingService()
|
net = makeMessagingService()
|
||||||
runOnStop += Runnable { net.stop() }
|
|
||||||
wallet = makeWalletService()
|
wallet = makeWalletService()
|
||||||
|
|
||||||
identity = makeIdentityService()
|
identity = makeIdentityService()
|
||||||
@ -211,6 +210,7 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
|
|||||||
ScheduledActivityObserver(services)
|
ScheduledActivityObserver(services)
|
||||||
|
|
||||||
startMessagingService()
|
startMessagingService()
|
||||||
|
runOnStop += Runnable { net.stop() }
|
||||||
_networkMapRegistrationFuture.setFuture(registerWithNetworkMap())
|
_networkMapRegistrationFuture.setFuture(registerWithNetworkMap())
|
||||||
isPreviousCheckpointsPresent = checkpointStorage.checkpoints.any()
|
isPreviousCheckpointsPresent = checkpointStorage.checkpoints.any()
|
||||||
smm.start()
|
smm.start()
|
||||||
|
@ -281,7 +281,7 @@ class Node(dir: Path, val p2pAddr: HostAndPort, val webServerAddr: HostAndPort,
|
|||||||
shutdown = true
|
shutdown = true
|
||||||
|
|
||||||
// Unregister shutdown hook to prevent any unnecessary second calls to stop
|
// Unregister shutdown hook to prevent any unnecessary second calls to stop
|
||||||
if(shutdownThread != null) {
|
if((shutdownThread != null) && (Thread.currentThread() != shutdownThread)){
|
||||||
Runtime.getRuntime().removeShutdownHook(shutdownThread)
|
Runtime.getRuntime().removeShutdownHook(shutdownThread)
|
||||||
shutdownThread = null
|
shutdownThread = null
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user