Stop unused Artery outbound streams, #23967

* fix memory leak in SystemMessageDelivery
* initial set of tests for idle outbound associations, credit to mboogerd
* close inbound compression when quarantined, #23967
  * make sure compressions for quarantined are removed in case they are lingering around
  * also means that advertise will not be done for quarantined
  * remove tombstone in InboundCompressions
* simplify async callbacks by using invokeWithFeedback
* compression for old incarnation, #24400
  * it was fixed by the other previous changes
  * also confirmed by running the SimpleClusterApp with TCP
    as described in the ticket
* test with tcp and tls-tcp transport
  * handle the stop signals differently for tcp transport because they
    are converted to StreamTcpException
* cancel timers on shutdown
* share the top-level FR for all Association instances
* use linked queue for control and large streams, less memory usage
* remove quarantined idle Association completely after a configured delay
  * note that shallow Association instances may still lingering in the
    heap because of cached references from RemoteActorRef, which may
    be cached by LruBoundedCache (used by resolve actor ref).
    Those are small, since the queues have been removed, and the cache
    is bounded.
This commit is contained in:
Patrik Nordwall 2017-11-20 15:15:17 +01:00
parent 39c97c3306
commit 5e80bd97f2
23 changed files with 909 additions and 320 deletions

View file

@ -7,9 +7,12 @@ import scala.concurrent.duration._
import akka.actor.ActorIdentity
import akka.actor.ActorRef
import akka.actor.ExtendedActorSystem
import akka.actor.Identify
import akka.actor.PoisonPill
import akka.cluster.ClusterEvent.UnreachableMember
import akka.remote.RARP
import akka.remote.artery.ArterySettings
import akka.remote.testconductor.RoleName
import akka.remote.testkit.MultiNodeConfig
import akka.remote.testkit.MultiNodeSpec
@ -26,14 +29,14 @@ object LargeMessageClusterMultiJvmSpec extends MultiNodeConfig {
commonConfig(ConfigFactory.parseString(
"""
akka {
#loglevel = DEBUG
loglevel = DEBUG
cluster.debug.verbose-heartbeat-logging = on
loggers = ["akka.testkit.TestEventListener"]
actor.provider = cluster
testconductor.barrier-timeout = 3 minutes
cluster.failure-detector.acceptable-heartbeat-pause = 3 s
cluster.failure-detector.acceptable-heartbeat-pause = 5 s
remote.artery {
enabled = on
@ -128,21 +131,19 @@ abstract class LargeMessageClusterSpec extends MultiNodeSpec(LargeMessageCluster
"not disturb cluster heartbeat messages when saturated" taggedAs LongRunningTest in {
// FIXME only enabled for Aeron transport until #24576 is fixed
val arterySettings = ArterySettings(system.settings.config.getConfig("akka.remote.artery"))
if (!arterySettings.Enabled || arterySettings.Transport != ArterySettings.AeronUpd)
pending
runOn(second) {
val echo2 = identify(second, "echo")
val echo3 = identify(third, "echo")
val largeEcho2 = identify(second, "largeEcho")
val largeEcho3 = identify(third, "largeEcho")
val ordinaryMsgSize = 10 * 1024
val ordinaryMsg = ("0" * ordinaryMsgSize).getBytes("utf-8")
(1 to 5).foreach { _
echo2.tell(ordinaryMsg, echo3)
}
val largeMsgSize = 2 * 1000 * 1000
val largeMsgSize = 1 * 1000 * 1000
val largeMsg = ("0" * largeMsgSize).getBytes("utf-8")
(1 to 5).foreach { _
(1 to 3).foreach { _
// this will ping-pong between second and third
largeEcho2.tell(largeMsg, largeEcho3)
}
}