mirror of
https://github.com/corda/corda.git
synced 2025-01-11 15:32:49 +00:00
ENT-2053 Fix messaging TTL related settings causing disconnects (#3384)
* ENT-2053 Revert RPC TTL due to hanging RPC clients. * ENT-2053 Set TTL correctly.
This commit is contained in:
parent
d054238f19
commit
999ee49804
@ -8,16 +8,17 @@ import net.corda.core.context.Trace
|
|||||||
import net.corda.core.crypto.random63BitValue
|
import net.corda.core.crypto.random63BitValue
|
||||||
import net.corda.core.internal.logElapsedTime
|
import net.corda.core.internal.logElapsedTime
|
||||||
import net.corda.core.internal.uncheckedCast
|
import net.corda.core.internal.uncheckedCast
|
||||||
|
import net.corda.core.messaging.ClientRpcSslOptions
|
||||||
import net.corda.core.messaging.RPCOps
|
import net.corda.core.messaging.RPCOps
|
||||||
import net.corda.core.serialization.SerializationContext
|
import net.corda.core.serialization.SerializationContext
|
||||||
import net.corda.core.serialization.SerializationDefaults
|
import net.corda.core.serialization.SerializationDefaults
|
||||||
import net.corda.core.serialization.internal.nodeSerializationEnv
|
import net.corda.core.serialization.internal.nodeSerializationEnv
|
||||||
import net.corda.core.utilities.*
|
import net.corda.core.utilities.NetworkHostAndPort
|
||||||
|
import net.corda.core.utilities.contextLogger
|
||||||
import net.corda.nodeapi.ArtemisTcpTransport.Companion.rpcConnectorTcpTransport
|
import net.corda.nodeapi.ArtemisTcpTransport.Companion.rpcConnectorTcpTransport
|
||||||
import net.corda.nodeapi.ArtemisTcpTransport.Companion.rpcConnectorTcpTransportsFromList
|
import net.corda.nodeapi.ArtemisTcpTransport.Companion.rpcConnectorTcpTransportsFromList
|
||||||
import net.corda.nodeapi.ArtemisTcpTransport.Companion.rpcInternalClientTcpTransport
|
import net.corda.nodeapi.ArtemisTcpTransport.Companion.rpcInternalClientTcpTransport
|
||||||
import net.corda.nodeapi.RPCApi
|
import net.corda.nodeapi.RPCApi
|
||||||
import net.corda.core.messaging.ClientRpcSslOptions
|
|
||||||
import net.corda.nodeapi.internal.config.SSLConfiguration
|
import net.corda.nodeapi.internal.config.SSLConfiguration
|
||||||
import org.apache.activemq.artemis.api.core.SimpleString
|
import org.apache.activemq.artemis.api.core.SimpleString
|
||||||
import org.apache.activemq.artemis.api.core.TransportConfiguration
|
import org.apache.activemq.artemis.api.core.TransportConfiguration
|
||||||
@ -74,6 +75,8 @@ class RPCClient<I : RPCOps>(
|
|||||||
} else {
|
} else {
|
||||||
ActiveMQClient.createServerLocatorWithoutHA(*haPoolTransportConfigurations.toTypedArray())
|
ActiveMQClient.createServerLocatorWithoutHA(*haPoolTransportConfigurations.toTypedArray())
|
||||||
}).apply {
|
}).apply {
|
||||||
|
connectionTTL = 60000
|
||||||
|
clientFailureCheckPeriod = 30000
|
||||||
retryInterval = rpcConfiguration.connectionRetryInterval.toMillis()
|
retryInterval = rpcConfiguration.connectionRetryInterval.toMillis()
|
||||||
retryIntervalMultiplier = rpcConfiguration.connectionRetryIntervalMultiplier
|
retryIntervalMultiplier = rpcConfiguration.connectionRetryIntervalMultiplier
|
||||||
maxRetryInterval = rpcConfiguration.connectionMaxRetryInterval.toMillis()
|
maxRetryInterval = rpcConfiguration.connectionMaxRetryInterval.toMillis()
|
||||||
|
@ -39,7 +39,7 @@ class ArtemisMessagingClient(private val config: SSLConfiguration,
|
|||||||
// Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this
|
// Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this
|
||||||
// would be the default and the two lines below can be deleted.
|
// would be the default and the two lines below can be deleted.
|
||||||
connectionTTL = 60000
|
connectionTTL = 60000
|
||||||
clientFailureCheckPeriod = -1
|
clientFailureCheckPeriod = 30000
|
||||||
minLargeMessageSize = maxMessageSize
|
minLargeMessageSize = maxMessageSize
|
||||||
isUseGlobalPools = nodeSerializationEnv != null
|
isUseGlobalPools = nodeSerializationEnv != null
|
||||||
addIncomingInterceptor(ArtemisMessageSizeChecksInterceptor(maxMessageSize))
|
addIncomingInterceptor(ArtemisMessageSizeChecksInterceptor(maxMessageSize))
|
||||||
|
@ -27,7 +27,7 @@ class InternalRPCMessagingClient(val sslConfig: SSLConfiguration, val serverAddr
|
|||||||
// Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this
|
// Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this
|
||||||
// would be the default and the two lines below can be deleted.
|
// would be the default and the two lines below can be deleted.
|
||||||
connectionTTL = 60000
|
connectionTTL = 60000
|
||||||
clientFailureCheckPeriod = -1
|
clientFailureCheckPeriod = 30000
|
||||||
minLargeMessageSize = maxMessageSize
|
minLargeMessageSize = maxMessageSize
|
||||||
isUseGlobalPools = nodeSerializationEnv != null
|
isUseGlobalPools = nodeSerializationEnv != null
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ class P2PMessagingClient(val config: NodeConfiguration,
|
|||||||
// Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this
|
// Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this
|
||||||
// would be the default and the two lines below can be deleted.
|
// would be the default and the two lines below can be deleted.
|
||||||
connectionTTL = 60000
|
connectionTTL = 60000
|
||||||
clientFailureCheckPeriod = -1
|
clientFailureCheckPeriod = 30000
|
||||||
minLargeMessageSize = maxMessageSize + JOURNAL_HEADER_SIZE
|
minLargeMessageSize = maxMessageSize + JOURNAL_HEADER_SIZE
|
||||||
isUseGlobalPools = nodeSerializationEnv != null
|
isUseGlobalPools = nodeSerializationEnv != null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user