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