mirror of
https://github.com/corda/corda.git
synced 2025-02-22 18:12:53 +00:00
Merge pull request #4329 from corda/pat/ent-1620-cherry-pick
Stop messaging services before node dies, to prevent port hogging when using in process node (#1620)
This commit is contained in:
commit
3444d6c075
@ -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…
x
Reference in New Issue
Block a user