mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +00:00
Stop messaging services before node dies, to prevent port hogging when using in process node (#1620)
(cherry picked from commit 15c11d964f
)
This commit is contained in:
parent
11e7bf5bbc
commit
4f41dff6cd
@ -352,7 +352,13 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
||||
netParams,
|
||||
keyManagementService,
|
||||
configuration.networkParameterAcceptanceSettings)
|
||||
startMessagingService(rpcOps, nodeInfo, myNotaryIdentity, netParams)
|
||||
try {
|
||||
startMessagingService(rpcOps, nodeInfo, myNotaryIdentity, netParams)
|
||||
} catch (e: Exception) {
|
||||
// Try to stop any started messaging services.
|
||||
stop()
|
||||
throw e
|
||||
}
|
||||
|
||||
// Do all of this in a database transaction so anything that might need a connection has one.
|
||||
return database.transaction {
|
||||
@ -838,6 +844,7 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
||||
nodeInfo: NodeInfo,
|
||||
myNotaryIdentity: PartyAndCertificate?,
|
||||
networkParameters: NetworkParameters)
|
||||
|
||||
/**
|
||||
* Loads or generates the node's legal identity and key-pair.
|
||||
* Note that obtainIdentity returns a KeyPair with an [AliasPrivateKey].
|
||||
|
Loading…
Reference in New Issue
Block a user