diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala index 7338de2922..856a90835d 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala @@ -18,7 +18,7 @@ object ActorRefSerializationSpec { serialize-messages = off allow-java-serialization = true } - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """) diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/WeightedRouteesSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/WeightedRouteesSpec.scala index 68ea64a4a8..5ce09beb25 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/WeightedRouteesSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/WeightedRouteesSpec.scala @@ -15,7 +15,7 @@ import scala.Vector class WeightedRouteesSpec extends AkkaSpec(ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """)) { diff --git a/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java b/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java index 60211ad0c3..2af5ab2f48 100644 --- a/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java +++ b/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java @@ -28,7 +28,7 @@ public class ClusterShardingPersistenceTest extends JUnitSuite { public static final Config config = ConfigFactory.parseString( "akka.actor.provider = cluster \n" - + "akka.remote.netty.tcp.port = 0 \n" + + "akka.remote.classic.netty.tcp.port = 0 \n" + "akka.remote.artery.canonical.port = 0 \n" + "akka.remote.artery.canonical.hostname = 127.0.0.1 \n" + "akka.persistence.journal.plugin = \"akka.persistence.journal.inmem\" \n"); diff --git a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java index beb9321bac..f240620b49 100644 --- a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java +++ b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java @@ -25,7 +25,7 @@ public class HelloWorldEventSourcedEntityExampleTest extends JUnitSuite { public static final Config config = ConfigFactory.parseString( "akka.actor.provider = cluster \n" - + "akka.remote.netty.tcp.port = 0 \n" + + "akka.remote.classic.netty.tcp.port = 0 \n" + "akka.remote.artery.canonical.port = 0 \n" + "akka.remote.artery.canonical.hostname = 127.0.0.1 \n" + "akka.persistence.journal.plugin = \"akka.persistence.journal.inmem\" \n"); diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala index 8ebe1441b8..07f3d0be2f 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala @@ -26,7 +26,7 @@ object JoinConfig { akka.cluster.configuration-compatibility-check.enforce-on-join = on akka.cluster.jmx.enabled = off akka.coordinated-shutdown.terminate-actor-system = on - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """).withFallback(AkkaSpec.testConf) diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala index bcb179b835..02e3b837a7 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala @@ -40,7 +40,7 @@ object ClusterShardingPersistenceSpec { akka.actor.provider = cluster - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala index 26acd3ac6d..1956ea27d0 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala @@ -38,7 +38,7 @@ object ClusterShardingSpec { akka.actor.provider = cluster // akka.loglevel = debug - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 diff --git a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala index 77bea06316..bf74a7aa5b 100644 --- a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala @@ -16,7 +16,7 @@ object HelloWorldEventSourcedEntityExampleSpec { val config = ConfigFactory.parseString(""" akka.actor.provider = cluster - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingInternalsSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingInternalsSpec.scala index 1687128342..72f7b4a52d 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingInternalsSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingInternalsSpec.scala @@ -30,7 +30,7 @@ object ClusterShardingInternalsSpec { class ClusterShardingInternalsSpec extends AkkaSpec(""" |akka.actor.provider = cluster - |akka.remote.netty.tcp.port = 0 + |akka.remote.classic.netty.tcp.port = 0 |akka.remote.artery.canonical.port = 0 |""".stripMargin) with MockitoSugar { import ClusterShardingInternalsSpec._ diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala index 29bad859eb..a5729ed611 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala @@ -19,7 +19,7 @@ object ClusterShardingLeaseSpec { akka.loglevel = DEBUG #akka.loggers = ["akka.testkit.SilenceAllTestEventListener"] akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.cluster.sharding { use-lease = "test-lease" diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ConcurrentStartupShardingSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ConcurrentStartupShardingSpec.scala index 1f6ca0c62f..777368859b 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ConcurrentStartupShardingSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ConcurrentStartupShardingSpec.scala @@ -20,7 +20,7 @@ object ConcurrentStartupShardingSpec { val config = """ akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.log-dead-letters = off akka.log-dead-letters-during-shutdown = off diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/CoordinatedShutdownShardingSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/CoordinatedShutdownShardingSpec.scala index 8836255aa0..822ac721d1 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/CoordinatedShutdownShardingSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/CoordinatedShutdownShardingSpec.scala @@ -23,7 +23,7 @@ object CoordinatedShutdownShardingSpec { """ akka.loggers = ["akka.testkit.SilenceAllTestEventListener"] akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """ diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/GetShardTypeNamesSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/GetShardTypeNamesSpec.scala index 0c35711f0d..4785112bfb 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/GetShardTypeNamesSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/GetShardTypeNamesSpec.scala @@ -14,7 +14,7 @@ object GetShardTypeNamesSpec { """ akka.loglevel = INFO akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """ diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/InactiveEntityPassivationSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/InactiveEntityPassivationSpec.scala index 88147b27dd..7b75869633 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/InactiveEntityPassivationSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/InactiveEntityPassivationSpec.scala @@ -18,7 +18,7 @@ object InactiveEntityPassivationSpec { val config = ConfigFactory.parseString(""" akka.loglevel = INFO akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.actor.serialize-messages = off """) diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala index 464aed9b7d..21f16f167a 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala @@ -25,7 +25,7 @@ class JoinConfigCompatCheckShardingSpec extends AkkaSpec() { ConfigFactory.parseString(""" akka.actor.provider = "cluster" akka.coordinated-shutdown.terminate-actor-system = on - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """) diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ProxyShardingSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ProxyShardingSpec.scala index 75c0ae4504..7c7ed94bee 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ProxyShardingSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ProxyShardingSpec.scala @@ -14,7 +14,7 @@ import scala.concurrent.duration.FiniteDuration object ProxyShardingSpec { val config = """ akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """ } diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala index 5d980500b6..d6338272ae 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala @@ -29,7 +29,7 @@ object RemoveInternalClusterShardingDataSpec { val config = """ akka.loglevel = INFO akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.persistence.journal.plugin = "akka.persistence.journal.leveldb" akka.persistence.journal.leveldb { diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardSpec.scala index fcda200c97..74f9e8734c 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardSpec.scala @@ -22,7 +22,7 @@ object ShardSpec { """ akka.loglevel = INFO akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 test-lease { lease-class = akka.cluster.TestLease diff --git a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala index 2cd22f7bc5..43d2fd7b09 100644 --- a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala +++ b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala @@ -497,7 +497,7 @@ class ClusterClientSpec extends MultiNodeSpec(ClusterClientSpec) with STMultiNod system.name, ConfigFactory.parseString(s""" akka.remote.artery.canonical.port=$port - akka.remote.netty.tcp.port=$port + akka.remote.classic.netty.tcp.port=$port """).withFallback(system.settings.config)) Cluster(sys2).join(Cluster(sys2).selfAddress) val service2 = sys2.actorOf(Props(classOf[TestService], testActor), "service2") diff --git a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala index 8abf1d7d7e..7b86153c5a 100644 --- a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala +++ b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala @@ -141,7 +141,7 @@ class DistributedPubSubRestartSpec val port = Cluster(system).selfAddress.port.get val config = ConfigFactory.parseString(s""" akka.remote.artery.canonical.port=$port - akka.remote.netty.tcp.port=$port + akka.remote.classic.netty.tcp.port=$port """).withFallback(system.settings.config) ActorSystem(system.name, config) diff --git a/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java b/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java index c99e91b94c..06ea64abd9 100644 --- a/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java +++ b/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java @@ -23,7 +23,7 @@ public class ClusterClientTest extends JUnitSuite { "DistributedPubSubMediatorTest", ConfigFactory.parseString( "akka.actor.provider = \"cluster\"\n" - + "akka.remote.netty.tcp.port=0\n" + + "akka.remote.classic.netty.tcp.port=0\n" + "akka.remote.artery.canonical.port=0")); private final ActorSystem system = actorSystemResource.getSystem(); diff --git a/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java b/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java index c93bf686b5..b827f51c6a 100644 --- a/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java +++ b/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java @@ -27,7 +27,7 @@ public class DistributedPubSubMediatorTest extends JUnitSuite { "DistributedPubSubMediatorTest", ConfigFactory.parseString( "akka.actor.provider = \"cluster\"\n" - + "akka.remote.netty.tcp.port=0\n" + + "akka.remote.classic.netty.tcp.port=0\n" + "akka.remote.artery.canonical.port=0")); private final ActorSystem system = actorSystemResource.getSystem(); diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorDeadLettersSpec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorDeadLettersSpec.scala index 743855e19f..89fc1859c2 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorDeadLettersSpec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorDeadLettersSpec.scala @@ -14,7 +14,7 @@ object DistributedPubSubMediatorDeadLettersSpec { s""" akka.loglevel = INFO akka.actor.provider = "cluster" - akka.remote.netty.tcp.port=0 + akka.remote.classic.netty.tcp.port=0 akka.remote.artery.canonical.port=0 akka.remote.log-remote-lifecycle-events = off akka.cluster.pub-sub.send-to-dead-letters-when-no-subscribers = $sendToDeadLettersWhenNoSubscribers diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala index ce13f5f6bd..3925756d1a 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala @@ -21,7 +21,7 @@ object DistributedPubSubMediatorRouterSpec { akka.loglevel = INFO akka.actor.provider = "cluster" akka.actor.serialize-messages = off - akka.remote.netty.tcp.port=0 + akka.remote.classic.netty.tcp.port=0 akka.remote.artery.canonical.port=0 akka.remote.log-remote-lifecycle-events = off akka.cluster.pub-sub.routing-logic = $routingLogic diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestart2Spec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestart2Spec.scala index 8718568d51..5a78eef507 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestart2Spec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestart2Spec.scala @@ -102,7 +102,7 @@ class ClusterSingletonRestart2Spec extends AkkaSpec(""" val sys4Config = ConfigFactory.parseString(s""" akka.remote.artery.canonical.port=$sys2port - akka.remote.netty.tcp.port=$sys2port + akka.remote.classic.netty.tcp.port=$sys2port """).withFallback(system.settings.config) ActorSystem(system.name, sys4Config) diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestartSpec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestartSpec.scala index 73b76c1781..6b65409315 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestartSpec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonRestartSpec.scala @@ -77,7 +77,7 @@ class ClusterSingletonRestartSpec extends AkkaSpec(""" val sys3Config = ConfigFactory.parseString(s""" akka.remote.artery.canonical.port=$sys1port - akka.remote.netty.tcp.port=$sys1port + akka.remote.classic.netty.tcp.port=$sys1port """).withFallback(system.settings.config) ActorSystem(system.name, sys3Config) diff --git a/akka-cluster-typed/src/test/java/akka/cluster/ddata/typed/javadsl/ReplicatorTest.java b/akka-cluster-typed/src/test/java/akka/cluster/ddata/typed/javadsl/ReplicatorTest.java index d3f670e896..1d4c7687ec 100644 --- a/akka-cluster-typed/src/test/java/akka/cluster/ddata/typed/javadsl/ReplicatorTest.java +++ b/akka-cluster-typed/src/test/java/akka/cluster/ddata/typed/javadsl/ReplicatorTest.java @@ -191,7 +191,7 @@ public class ReplicatorTest extends JUnitSuite { static Config config = ConfigFactory.parseString( "akka.actor.provider = cluster \n" - + "akka.remote.netty.tcp.port = 0 \n" + + "akka.remote.classic.netty.tcp.port = 0 \n" + "akka.remote.artery.canonical.port = 0 \n" + "akka.remote.artery.canonical.hostname = 127.0.0.1 \n"); diff --git a/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java b/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java index 1c113ddb71..ecfc434267 100644 --- a/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java +++ b/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java @@ -21,7 +21,7 @@ public class ClusterApiTest extends JUnitSuite { Config config = ConfigFactory.parseString( "akka.actor.provider = cluster \n" - + "akka.remote.netty.tcp.port = 0 \n" + + "akka.remote.classic.netty.tcp.port = 0 \n" + "akka.remote.artery.canonical.port = 0 \n" + "akka.remote.artery.canonical.hostname = 127.0.0.1 \n" + "akka.cluster.jmx.multi-mbeans-in-same-jvm = on \n" diff --git a/akka-cluster-typed/src/test/java/jdocs/akka/cluster/typed/BasicClusterExampleTest.java b/akka-cluster-typed/src/test/java/jdocs/akka/cluster/typed/BasicClusterExampleTest.java index fd8013bdbc..eeea72eae1 100644 --- a/akka-cluster-typed/src/test/java/jdocs/akka/cluster/typed/BasicClusterExampleTest.java +++ b/akka-cluster-typed/src/test/java/jdocs/akka/cluster/typed/BasicClusterExampleTest.java @@ -31,7 +31,7 @@ public class BasicClusterExampleTest { // extends JUnitSuite { private Config noPort = ConfigFactory.parseString( - " akka.remote.netty.tcp.port = 0 \n" + " akka.remote.classic.netty.tcp.port = 0 \n" + " akka.remote.artery.canonical.port = 0 \n"); // @Test diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala index 81a7c1b35a..401f4ca5a1 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala @@ -28,7 +28,7 @@ object ReplicatorSpec { val config = ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 """) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala index 92bc5bb7ce..a58db1503c 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala @@ -27,7 +27,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with override implicit val patienceConfig = PatienceConfig(1.second) val config = ConfigFactory.parseString(""" akka.actor.provider = cluster - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 """) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala index abe5e56f08..e404c981ec 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala @@ -18,7 +18,7 @@ object ClusterApiSpec { val config = ConfigFactory.parseString(""" akka.actor.provider = cluster - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 akka.cluster.jmx.multi-mbeans-in-same-jvm = on diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala index 98763c5e40..997ee2a779 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala @@ -37,7 +37,7 @@ object ClusterSingletonApiSpec { "akka.cluster.typed.ClusterSingletonApiSpec$$Perish$$" = test } } - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 akka.cluster.jmx.multi-mbeans-in-same-jvm = on diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala index 014cd13ef6..85796bfe8e 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala @@ -15,7 +15,7 @@ import org.scalatest.WordSpecLike object ClusterSingletonPersistenceSpec { val config = ConfigFactory.parseString(""" akka.actor.provider = cluster - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala index d33bb36375..937732b0ef 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala @@ -58,8 +58,8 @@ object RemoteContextAskSpec { "akka.cluster.typed.RemoteContextAskSpec$$Pong$$" = test } } - remote.netty.tcp.port = 0 - remote.netty.tcp.host = 127.0.0.1 + remote.classic.netty.tcp.port = 0 + remote.classic.netty.tcp.host = 127.0.0.1 remote.artery { canonical { hostname = 127.0.0.1 diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala index affa92dc87..0a9b7327fe 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala @@ -23,7 +23,7 @@ object RemoteDeployNotAllowedSpec { warn-about-java-serializer-usage = off serialize-creators = off } - remote.netty.tcp.port = 0 + remote.classic.netty.tcp.port = 0 remote.artery { canonical { hostname = 127.0.0.1 diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala index c4469745bb..baabb38425 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala @@ -46,7 +46,7 @@ object RemoteMessageSpec { "akka.cluster.typed.RemoteMessageSpec$$Ping" = test } } - remote.netty.tcp.port = 0 + remote.classic.netty.tcp.port = 0 remote.artery { canonical { hostname = 127.0.0.1 diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala index a83e111092..12da371af2 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala @@ -41,8 +41,8 @@ object ClusterReceptionistSpec { "akka.cluster.typed.internal.receptionist.ClusterReceptionistSpec$$Perish$$" = test } } - akka.remote.netty.tcp.port = 0 - akka.remote.netty.tcp.host = 127.0.0.1 + akka.remote.classic.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.host = 127.0.0.1 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1 @@ -345,7 +345,7 @@ class ClusterReceptionistSpec extends WordSpec with Matchers { val testKit3 = ActorTestKit( system1.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${clusterNode2.selfMember.address.port.get} + akka.remote.classic.netty.tcp.port = ${clusterNode2.selfMember.address.port.get} akka.remote.artery.canonical.port = ${clusterNode2.selfMember.address.port.get} # retry joining when existing member removed akka.cluster.retry-unsuccessful-join-after = 1s @@ -456,7 +456,7 @@ class ClusterReceptionistSpec extends WordSpec with Matchers { val testKit3 = ActorTestKit( system1.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${clusterNode2.selfMember.address.port.get} + akka.remote.classic.netty.tcp.port = ${clusterNode2.selfMember.address.port.get} akka.remote.artery.canonical.port = ${clusterNode2.selfMember.address.port.get} """).withFallback(config)) diff --git a/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala b/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala index ded6cb8177..66bbb095fa 100644 --- a/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala +++ b/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala @@ -44,7 +44,7 @@ akka { """) val configSystem2 = ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """).withFallback(configSystem1) } @@ -61,7 +61,7 @@ class BasicClusterConfigSpec extends WordSpec with ScalaFutures with Eventually val sys1Port = SocketUtil.temporaryLocalPort() val sys2Port = SocketUtil.temporaryLocalPort() def config(port: Int) = ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = $port + akka.remote.classic.netty.tcp.port = $port akka.cluster.seed-nodes = [ "akka.tcp://ClusterSystem@127.0.0.1:$sys1Port", "akka.tcp://ClusterSystem@127.0.0.1:$sys2Port" ] """) @@ -97,7 +97,7 @@ akka { """) val noPort = ConfigFactory.parseString(""" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """) diff --git a/akka-cluster/src/main/resources/reference.conf b/akka-cluster/src/main/resources/reference.conf index c384d6e1ea..b723c2185a 100644 --- a/akka-cluster/src/main/resources/reference.conf +++ b/akka-cluster/src/main/resources/reference.conf @@ -316,6 +316,8 @@ akka { "user.home", "user.name", "user.dir", "socksNonProxyHosts", "http.nonProxyHosts", "ftp.nonProxyHosts", "akka.remote.secure-cookie", + "akka.remote.classic.netty.ssl.security", + # Pre 2.6 path, keep around to avoid sending things misconfigured with old paths "akka.remote.netty.ssl.security", "akka.remote.artery.ssl" ] diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcHeartbeatTakingOverSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcHeartbeatTakingOverSpec.scala index 6b08a117d4..7c76c356a1 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcHeartbeatTakingOverSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcHeartbeatTakingOverSpec.scala @@ -44,7 +44,7 @@ object MultiDcHeartbeatTakingOverSpecMultiJvmSpec extends MultiNodeConfig { loggers = ["akka.testkit.TestEventListener"] loglevel = INFO - remote.log-remote-lifecycle-events = off + remote.classic.log-remote-lifecycle-events = off cluster { debug.verbose-heartbeat-logging = off diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcSplitBrainSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcSplitBrainSpec.scala index 3f95da539f..33f4097222 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcSplitBrainSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiDcSplitBrainSpec.scala @@ -23,11 +23,12 @@ object MultiDcSplitBrainMultiJvmSpec extends MultiNodeConfig { val fifth = role("fifth") commonConfig( - ConfigFactory.parseString(""" + ConfigFactory + .parseString(""" akka.loglevel = DEBUG # issue #24955 akka.cluster.debug.verbose-heartbeat-logging = on akka.cluster.debug.verbose-gossip-logging = on - akka.remote.netty.tcp.connection-timeout = 5 s # speedup in case of connection issue + akka.remote.classic.netty.tcp.connection-timeout = 5 s # speedup in case of connection issue akka.remote.retry-gate-closed-for = 1 s akka.cluster.multi-data-center { failure-detector { @@ -40,7 +41,8 @@ object MultiDcSplitBrainMultiJvmSpec extends MultiNodeConfig { leader-actions-interval = 1s auto-down-unreachable-after = 1s } - """).withFallback(MultiNodeClusterSpec.clusterConfig)) + """) + .withFallback(MultiNodeClusterSpec.clusterConfig)) nodeConfig(first, second)(ConfigFactory.parseString(""" akka.cluster.multi-data-center.self-data-center = "dc1" @@ -240,7 +242,7 @@ abstract class MultiDcSplitBrainSpec extends MultiNodeSpec(MultiDcSplitBrainMult val restartedSystem = ActorSystem( system.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = $port + akka.remote.classic.netty.tcp.port = $port akka.remote.artery.canonical.port = $port akka.coordinated-shutdown.terminate-actor-system = on """).withFallback(system.settings.config)) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeChurnSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeChurnSpec.scala index 0e9f198f37..3cac1e099b 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeChurnSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeChurnSpec.scala @@ -25,7 +25,7 @@ object NodeChurnMultiJvmSpec extends MultiNodeConfig { akka.cluster.auto-down-unreachable-after = 1s akka.cluster.prune-gossip-tombstones-after = 1s akka.remote.log-frame-size-exceeding = 1200b - akka.remote.artery.advanced { + akka.remote.artery.advanced.aeron { idle-cpu-level = 1 embedded-media-driver = off aeron-dir = "target/aeron-NodeChurnSpec" diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/QuickRestartSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/QuickRestartSpec.scala index 4999556ae0..2ceb9f3adb 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/QuickRestartSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/QuickRestartSpec.scala @@ -69,7 +69,7 @@ abstract class QuickRestartSpec // use the same port ConfigFactory.parseString(s""" akka.cluster.roles = [round-$n] - akka.remote.netty.tcp.port = ${Cluster(restartingSystem).selfAddress.port.get} + akka.remote.classic.netty.tcp.port = ${Cluster(restartingSystem).selfAddress.port.get} akka.remote.artery.canonical.port = ${Cluster(restartingSystem).selfAddress.port.get} """).withFallback(system.settings.config)) log.info("Restarting node has address: {}", Cluster(restartingSystem).selfUniqueAddress) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala index 3fcfc8542a..8b1b2d7c64 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala @@ -57,7 +57,7 @@ abstract class RestartFirstSeedNodeSpec lazy val restartedSeed1System = ActorSystem( system.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${seedNodes.head.port.get} + akka.remote.classic.netty.tcp.port = ${seedNodes.head.port.get} akka.remote.artery.canonical.port = ${seedNodes.head.port.get} """).withFallback(system.settings.config)) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode2Spec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode2Spec.scala index b6a34bb808..a63dba624c 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode2Spec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode2Spec.scala @@ -57,7 +57,7 @@ abstract class RestartNode2SpecSpec lazy val restartedSeed1System = ActorSystem( system.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${seedNodes.head.port.get} + akka.remote.classic.netty.tcp.port = ${seedNodes.head.port.get} akka.remote.artery.canonical.port = ${seedNodes.head.port.get} #akka.remote.retry-gate-closed-for = 1s """).withFallback(system.settings.config)) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode3Spec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode3Spec.scala index 3942635dc8..45ff1bcf5e 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode3Spec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNode3Spec.scala @@ -57,7 +57,7 @@ abstract class RestartNode3Spec system.name, ConfigFactory.parseString(s""" akka.remote.artery.canonical.port = ${secondUniqueAddress.address.port.get} - akka.remote.netty.tcp.port = ${secondUniqueAddress.address.port.get} + akka.remote.classic.netty.tcp.port = ${secondUniqueAddress.address.port.get} """).withFallback(system.settings.config)) override def afterAll(): Unit = { diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala index 377db036d9..432ab9b095 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala @@ -76,7 +76,7 @@ abstract class RestartNodeSpec lazy val restartedSecondSystem = ActorSystem( system.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${secondUniqueAddress.address.port.get} + akka.remote.classic.netty.tcp.port = ${secondUniqueAddress.address.port.get} akka.remote.artery.canonical.port = ${secondUniqueAddress.address.port.get} """).withFallback(system.settings.config)) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/SharedMediaDriverSupport.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/SharedMediaDriverSupport.scala index 47fd6c21f8..54bc3c1c38 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/SharedMediaDriverSupport.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/SharedMediaDriverSupport.scala @@ -32,7 +32,7 @@ object SharedMediaDriverSupport { def startMediaDriver(config: MultiNodeConfig): Unit = { val arterySettings = loadArterySettings(config) if (arterySettings.Enabled) { - val aeronDir = arterySettings.Advanced.AeronDirectoryName + val aeronDir = arterySettings.Advanced.Aeron.AeronDirectoryName require(aeronDir.nonEmpty, "aeron-dir must be defined") // Check if the media driver is already started by another multi-node jvm. @@ -63,10 +63,10 @@ object SharedMediaDriverSupport { if (isDriverInactive(MultiNodeSpec.selfIndex)) { val driverContext = new MediaDriver.Context driverContext.aeronDirectoryName(aeronDir) - driverContext.clientLivenessTimeoutNs(arterySettings.Advanced.ClientLivenessTimeout.toNanos) - driverContext.imageLivenessTimeoutNs(arterySettings.Advanced.ImageLivenessTimeout.toNanos) - driverContext.driverTimeoutMs(arterySettings.Advanced.DriverTimeout.toMillis) - val idleCpuLevel = arterySettings.Advanced.IdleCpuLevel + driverContext.clientLivenessTimeoutNs(arterySettings.Advanced.Aeron.ClientLivenessTimeout.toNanos) + driverContext.imageLivenessTimeoutNs(arterySettings.Advanced.Aeron.ImageLivenessTimeout.toNanos) + driverContext.driverTimeoutMs(arterySettings.Advanced.Aeron.DriverTimeout.toMillis) + val idleCpuLevel = arterySettings.Advanced.Aeron.IdleCpuLevel driverContext .threadingMode(ThreadingMode.SHARED) .sharedIdleStrategy(TaskRunner.createIdleStrategy(idleCpuLevel)) @@ -97,7 +97,7 @@ object SharedMediaDriverSupport { driver.close() try { - if (arterySettings.Advanced.DeleteAeronDirectory) { + if (arterySettings.Advanced.Aeron.DeleteAeronDirectory) { IoUtil.delete(new File(driver.aeronDirectoryName), false) } } catch { diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala index 40523e4a56..e43b21e71d 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala @@ -128,7 +128,7 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig { akka.loglevel = INFO akka.remote.log-remote-lifecycle-events = off - akka.remote.artery.advanced { + akka.remote.artery.advanced.aeron { idle-cpu-level = 1 embedded-media-driver = off aeron-dir = "target/aeron-StressSpec" diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala index 9260a4e62a..6674be2c52 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala @@ -36,9 +36,9 @@ object SurviveNetworkInstabilityMultiJvmSpec extends MultiNodeConfig { commonConfig( debugConfig(on = false) .withFallback(ConfigFactory.parseString(""" - akka.remote.system-message-buffer-size=100 + akka.remote.classic.system-message-buffer-size=100 akka.remote.artery.advanced.system-message-buffer-size=100 - akka.remote.netty.tcp.connection-timeout = 10s + akka.remote.classic.netty.tcp.connection-timeout = 10s """)) .withFallback(MultiNodeClusterSpec.clusterConfig)) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala index 5a8a1c09dc..4d0d7794ac 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala @@ -169,7 +169,7 @@ abstract class UnreachableNodeJoinsAgainSpec } """ else s""" - akka.remote.netty.tcp { + akka.remote.classic.netty.tcp { hostname = ${victimAddress.host.get} port = ${victimAddress.port.get} }""") diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala index 43f8f937cc..0c99b8c7f7 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala @@ -35,7 +35,7 @@ object ClusterDeployerSpec { cluster.allow-local-routees = off } } - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """, ConfigParseOptions.defaults) diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala index c3463ffdfa..06514a8f13 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala @@ -24,7 +24,7 @@ import akka.cluster.ClusterSettings.DefaultDataCenter object ClusterDomainEventPublisherSpec { val config = """ akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """ } diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterLogSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterLogSpec.scala index 6516168aa5..76ad00d18f 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterLogSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterLogSpec.scala @@ -17,7 +17,7 @@ object ClusterLogSpec { } akka.actor.provider = "cluster" akka.remote.log-remote-lifecycle-events = off - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.loglevel = "INFO" akka.loggers = ["akka.testkit.TestEventListener"] diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala index b864f5f3c4..7d92e7fc24 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala @@ -35,7 +35,7 @@ object ClusterSpec { } akka.actor.provider = "cluster" akka.remote.log-remote-lifecycle-events = off - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """ @@ -118,7 +118,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "ClusterSpec2", ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """)) try { @@ -152,7 +152,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "ClusterSpec2", ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """)) try { @@ -182,7 +182,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "ClusterSpec2", ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.coordinated-shutdown.terminate-actor-system = on """)) @@ -220,7 +220,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "ClusterSpec2", ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.cluster.min-nr-of-members = 2 """)) @@ -251,7 +251,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "ClusterSpec2", ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.coordinated-shutdown.terminate-actor-system = on """)) @@ -285,7 +285,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "ClusterSpec3", ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.coordinated-shutdown.terminate-actor-system = on akka.cluster.run-coordinated-shutdown-when-down = on @@ -311,7 +311,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "register multiple cluster JMX MBeans with akka.cluster.jmx.multi-mbeans-in-same-jvm = on" in { def getConfig = (port: Int) => ConfigFactory.parseString(s""" akka.cluster.jmx.multi-mbeans-in-same-jvm = on - akka.remote.netty.tcp.port = ${port} + akka.remote.classic.netty.tcp.port = ${port} akka.remote.artery.canonical.port = ${port} """).withFallback(ConfigFactory.parseString(ClusterSpec.config)) diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterTestKit.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterTestKit.scala index 880351be2d..51b55ff950 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterTestKit.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterTestKit.scala @@ -128,7 +128,7 @@ trait ClusterTestKit extends TestKitBase { actorSystems = actorSystems.filterNot(_ == actorSystem) val newConfig = ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = $port + akka.remote.classic.netty.tcp.port = $port akka.remote.artery.canonical.port = $port """).withFallback(config) diff --git a/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatCheckerSpec.scala b/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatCheckerSpec.scala index 604267e126..8b3ec9d1cf 100644 --- a/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatCheckerSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatCheckerSpec.scala @@ -16,7 +16,7 @@ object JoinConfigCompatCheckerSpec { ConfigFactory.parseString(""" akka.actor.provider = "cluster" akka.coordinated-shutdown.terminate-actor-system = on - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.cluster.jmx.multi-mbeans-in-same-jvm = on """) diff --git a/akka-cluster/src/test/scala/akka/cluster/ShutdownAfterJoinSeedNodesSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ShutdownAfterJoinSeedNodesSpec.scala index 116f29fbf6..b2b6775269 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ShutdownAfterJoinSeedNodesSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ShutdownAfterJoinSeedNodesSpec.scala @@ -17,7 +17,7 @@ object ShutdownAfterJoinSeedNodesSpec { val config = """ akka.actor.provider = "cluster" akka.coordinated-shutdown.terminate-actor-system = on - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.cluster { seed-node-timeout = 2s diff --git a/akka-cluster/src/test/scala/akka/cluster/StartupWithOneThreadSpec.scala b/akka-cluster/src/test/scala/akka/cluster/StartupWithOneThreadSpec.scala index 6262c99f2b..e7374d54b6 100644 --- a/akka-cluster/src/test/scala/akka/cluster/StartupWithOneThreadSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/StartupWithOneThreadSpec.scala @@ -16,7 +16,7 @@ object StartupWithOneThreadSpec { val config = """ akka.actor.provider = "cluster" akka.actor.creation-timeout = 10s - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.actor.default-dispatcher { diff --git a/akka-cluster/src/test/scala/akka/cluster/routing/ClusterRouterSupervisorSpec.scala b/akka-cluster/src/test/scala/akka/cluster/routing/ClusterRouterSupervisorSpec.scala index a6fa3be306..902b3aed77 100644 --- a/akka-cluster/src/test/scala/akka/cluster/routing/ClusterRouterSupervisorSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/routing/ClusterRouterSupervisorSpec.scala @@ -24,7 +24,7 @@ object ClusterRouterSupervisorSpec { class ClusterRouterSupervisorSpec extends AkkaSpec(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 """) { diff --git a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala index 0013ff53d3..dd9fd54f0c 100644 --- a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala +++ b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala @@ -19,11 +19,16 @@ import akka.actor.ActorRef import akka.testkit.TestKitExtension import akka.actor.ActorIdentity import akka.actor.Identify +import com.typesafe.config.ConfigFactory object ReliableProxySpec extends MultiNodeConfig { val local = role("local") val remote = role("remote") + commonConfig(ConfigFactory.parseString(""" + akka.remote.artery.enabled = false + """)) + testTransport(on = true) } diff --git a/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurableDataSpec.scala b/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurableDataSpec.scala index 5785cc26f1..890b683488 100644 --- a/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurableDataSpec.scala +++ b/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurableDataSpec.scala @@ -281,7 +281,7 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig) // use the same port ConfigFactory.parseString(s""" akka.remote.artery.canonical.port = ${address.port.get} - akka.remote.netty.tcp.port = ${address.port.get} + akka.remote.classic.netty.tcp.port = ${address.port.get} """).withFallback(system.settings.config)) try { Cluster(sys2).join(address) diff --git a/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurablePruningSpec.scala b/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurablePruningSpec.scala index 7ca1648efe..44c8260ca9 100644 --- a/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurablePruningSpec.scala +++ b/akka-distributed-data/src/multi-jvm/scala/akka/cluster/ddata/DurablePruningSpec.scala @@ -161,7 +161,7 @@ class DurablePruningSpec extends MultiNodeSpec(DurablePruningSpec) with STMultiN system.name, ConfigFactory.parseString(s""" akka.remote.artery.canonical.port = ${address.port.get} - akka.remote.netty.tcp.port = ${address.port.get} + akka.remote.classic.netty.tcp.port = ${address.port.get} """).withFallback(system.settings.config)) val cluster3 = Cluster(sys3) val replicator3 = startReplicator(sys3) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala index 6713944992..065370eeb8 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala @@ -51,7 +51,7 @@ class LocalConcurrencySpec(_system: ActorSystem) "LocalConcurrencySpec", ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port=0 + akka.remote.classic.netty.tcp.port=0 akka.remote.artery.canonical.port = 0 """))) } diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala index c2be186ae1..8130aaa6a5 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala @@ -31,7 +31,7 @@ object LotsOfDataBot { ports.foreach { port => // Override the configuration of the port val config = ConfigFactory - .parseString("akka.remote.netty.tcp.port=" + port) + .parseString("akka.remote.classic.netty.tcp.port=" + port) .withFallback( ConfigFactory.load(ConfigFactory.parseString(""" passive = off diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala index d41e84b146..6d79fb54ec 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala @@ -12,7 +12,7 @@ object ReplicatorSettingsSpec { val config = ConfigFactory.parseString(""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.remote.artery.canonical.hostname = 127.0.0.1""") } diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/WriteAggregatorSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/WriteAggregatorSpec.scala index 4a75e3b1fb..db5b2ab959 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/WriteAggregatorSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/WriteAggregatorSpec.scala @@ -130,7 +130,7 @@ object WriteAggregatorSpec { class WriteAggregatorSpec extends AkkaSpec(s""" akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 akka.remote.artery.canonical.port = 0 akka.cluster.distributed-data.durable.lmdb { dir = target/WriteAggregatorSpec-${System.currentTimeMillis}-ddata diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala index 9d88e56b9e..2562e8245d 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala @@ -33,7 +33,7 @@ class ReplicatedDataSerializerSpec ConfigFactory.parseString(""" akka.loglevel = DEBUG akka.actor.provider=cluster - akka.remote.netty.tcp.port=0 + akka.remote.classic.netty.tcp.port=0 akka.remote.artery.canonical.port = 0 akka.actor { serialize-messages = off diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala index 01c32a14af..5af818e622 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala @@ -37,7 +37,7 @@ class ReplicatorMessageSerializerSpec "ReplicatorMessageSerializerSpec", ConfigFactory.parseString(""" akka.actor.provider=cluster - akka.remote.netty.tcp.port=0 + akka.remote.classic.netty.tcp.port=0 akka.remote.artery.canonical.port = 0 akka.actor { serialize-messages = off diff --git a/akka-docs/src/main/paradox/additional/faq.md b/akka-docs/src/main/paradox/additional/faq.md index 95e19b9883..0ab6353d1b 100644 --- a/akka-docs/src/main/paradox/additional/faq.md +++ b/akka-docs/src/main/paradox/additional/faq.md @@ -119,7 +119,7 @@ Observe all the parts you need here: Most of the cases this is *tcp*. * `system` is the remote system’s name (must match exactly, case-sensitive!) * `host` is the remote system’s IP address or DNS name, and it must match that -system’s configuration (i.e. *akka.remote.netty.tcp.hostname*) +system’s configuration (i.e. *akka.remote.classic.netty.tcp.hostname*) * `1234` is the port number on which the remote system is listening for connections and receiving messages * `/user/my/actor/hierarchy/path` is the absolute path of the remote actor in @@ -137,10 +137,10 @@ system’s network location, e.g. because `host` was configured to be `0.0.0.0`, `localhost` or a NAT’ed IP address. If you are running an ActorSystem under a NAT or inside a docker container, make sure to -set *akka.remote.netty.tcp.hostname* and *akka.remote.netty.tcp.port* to the address +set *akka.remote.artery.hostname* and *akka.remote.artery.canonical.port* to the address it is reachable at from other ActorSystems. If you need to bind your network interface -to a different address - use *akka.remote.netty.tcp.bind-hostname* and -*akka.remote.netty.tcp.bind-port* settings. Also make sure your network is configured +to a different address - use *akka.remote.artery.bind.hostname* and +*akka.remote.artery.bind.port* settings. Also make sure your network is configured to translate from the address your ActorSystem is reachable at to the address your ActorSystem network interface is bound to. diff --git a/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md b/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md index 621216f62c..e7ac1d7905 100644 --- a/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md +++ b/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md @@ -24,9 +24,82 @@ If you are still using Scala 2.11 then you must upgrade to 2.12 or 2.13 Actor DSL is a rarely used feature and has been deprecated since `2.5.0`. Use plain `system.actorOf` instead of the DSL to create Actors if you have been using it. +## Default remoting is now Artery TCP + +@ref[Artery TCP](../remoting-artery.md) is now the default remoting implementation. +Classic remoting has been deprecated and will be removed in `2.7.0`. + + +### Migrating from classic remoting to Artery + +Artery has the same functionality as classic remoting and you should normally only have to change the +configuration to switch. +To switch a full cluster restart is required and any overrides for classic remoting need to be ported to Artery configuration. + +Artery defaults to TCP (see @ref:[selected transport](#selecting-a-transport)) which is a good start +when migrating from classic remoting. + +The protocol part in the Akka `Address`, for example `"akka.tcp://actorSystemName@10.0.0.1:2552/user/actorName"` +has changed from `akka.tcp` to `akka`. If you have configured or hardcoded any such addresses you have to change +them to `"akka://actorSystemName@10.0.0.1:2552/user/actorName"`. `akka` is used also when TLS is enabled. +One typical place where such address is used is in the `seed-nodes` configuration. + +The configuration is different, so you might have to revisit any custom configuration. See the full +@ref:[reference configuration for Artery](../general/configuration.md#config-akka-remote-artery) and +@ref:[reference configuration for classic remoting](../general/configuration.md#config-akka-remote). + +Configuration that is likely required to be ported: + +* `akka.remote.netty.tcp.hostname` => `akka.remote.artery.canonical.hostname` +* `akka.remote.netty.tcp.port`=> `akka.remote.artery.canonical.port` + +One thing to be aware of is that rolling update from classic remoting to Artery is not supported since the protocol +is completely different. It will require a full cluster shutdown and new startup. + +If using SSL then `tcp-tls` needs to be enabled and setup. See @ref[Artery docs for SSL](../remoting-artery.md#configuring-ssl-tls-for-akka-remoting) +for how to do this. + + +### Migration from 2.5.x Artery to 2.6.x Artery + +The following defaults have changed: + +* `akka.remote.artery.transport` default has changed from `aeron-udp` to `tcp` + +The following properties have moved. If you don't adjust these from their defaults no changes are required: + +For Aeron-UDP: + +* `akka.remote.artery.log-aeron-counters` to `akka.remote.artery.advanced.aeron.log-aeron-counters` +* `akka.remote.artery.advanced.embedded-media-driver` to `akka.remote.artery.advanced.aeron.embedded-media-driver` +* `akka.remote.artery.advanced.aeron-dir` to `akka.remote.artery.advanced.aeron.aeron-dir` +* `akka.remote.artery.advanced.delete-aeron-dir` to `akka.remote.artery.advanced.aeron.aeron-delete-dir` +* `akka.remote.artery.advanced.idle-cpu-level` to `akka.remote.artery.advanced.aeron.idle-cpu-level` +* `akka.remote.artery.advanced.give-up-message-after` to `akka.remote.artery.advanced.aeron.give-up-message-after` +* `akka.remote.artery.advanced.client-liveness-timeout` to `akka.remote.artery.advanced.aeron.client-liveness-timeout` +* `akka.remote.artery.advanced.image-liveless-timeout` to `akka.remote.artery.advanced.aeron.image-liveness-timeout` +* `akka.remote.artery.advanced.driver-timeout` to `akka.remote.artery.advanced.aeron.driver-timeout` + +For TCP: + +* `akka.remote.artery.advanced.connection-timeout` to `akka.remote.artery.advanced.tcp.connection-timeout` + + +### Remaining with Classic remoting (not recommended) + +Classic remoting is deprecated but can be used in `2.6.` Any configuration under `akka.remote` that is +specific to classic remoting needs to be moved to `akka.remote.classic`. To see which configuration options +are specific to classic search for them in: [`akka-remote/reference.conf`](/akka-remote/src/main/resources/reference.conf) + +## Netty UDP has been removed + +Classic remoting over UDP has been deprecated since `2.5.0` and now has been removed. +To continue to use UDP configure @ref[Artery UDP](../remoting-artery.md#configuring-ssl-tls-for-akka-remoting) or migrate to Artery TCP. +A full cluster restart is required to change to Artery. + ## Cluster Sharding ### Passivate idle entity The configuration `akka.cluster.sharding.passivate-idle-entity-after` is now enabled by default. Sharding will passivate entities when they have not received any messages after this duration. -Set to `off` to disable. \ No newline at end of file +Set \ No newline at end of file diff --git a/akka-docs/src/main/paradox/remoting-artery.md b/akka-docs/src/main/paradox/remoting-artery.md index 745ed0da07..b29795cbe2 100644 --- a/akka-docs/src/main/paradox/remoting-artery.md +++ b/akka-docs/src/main/paradox/remoting-artery.md @@ -1,4 +1,4 @@ -# Remoting (codename Artery) +# Artery Remoting @@@ note @@ -15,7 +15,7 @@ such as [HTTP](https://doc.akka.io/docs/akka-http/current/), ## Dependency -To use Remoting (codename Artery), you must add the following dependency in your project: +To use Artery Remoting, you must add the following dependency in your project: @@dependency[sbt,Maven,Gradle] { group=com.typesafe.akka @@ -37,7 +37,6 @@ akka { } remote { artery { - enabled = on transport = tcp # See Selecting a transport below canonical.hostname = "127.0.0.1" canonical.port = 25520 @@ -126,26 +125,7 @@ officially supported. If you're on a Big Endian processor, such as Sparc, it is ## Migrating from classic remoting -Artery TCP will be the default transport in Akka 2.6.0, and the @ref:[classic remoting implementation](remoting.md) -will be deprecated. - -Artery has the same functionality as classic remoting and you should normally only have to change the -configuration to switch. - -Enable Artery as shown in above @ref:[configuration](#configuration) with your -@ref:[selected transport](#selecting-a-transport). `tcp` is a good start. - -The protocol part in the Akka `Address`, for example `"akka.tcp://actorSystemName@10.0.0.1:2552/user/actorName"` -has changed from `akka.tcp` to `akka`. If you have configured or hardcoded any such addresses you have to change -them to `"akka://actorSystemName@10.0.0.1:2552/user/actorName"`. `akka` is used also when TLS is enabled. -One typical place where such address is used is in the `seed-nodes` configuration. - -The configuration is different, so you might have to revisit any custom configuration. See the full -@ref:[reference configuration for Artery](general/configuration.md#config-akka-remote-artery) and -@ref:[reference configuration for classic remoting](general/configuration.md#config-akka-remote). - -One thing to be aware of is that rolling update from classic remoting to Artery is not supported since the protocol -is completely different. It will require a full cluster shutdown and new startup. +See @ref:[migrating from classic remoting](project/migration-guide-2.5.x-2.6.x.md#classic-to-artery) ## Canonical address @@ -760,7 +740,7 @@ To use the external media driver from the Akka application you need to define th configuration properties: ``` -akka.remote.artery.advanced { +akka.remote.artery.advanced.aeron { embedded-media-driver = off aeron-dir = /dev/shm/aeron } @@ -786,7 +766,7 @@ usage and latency with the following configuration: ``` # Values can be from 1 to 10, where 10 strongly prefers low latency # and 1 strongly prefers less CPU usage -akka.remote.artery.advanced.idle-cpu-level = 1 +akka.remote.artery.advanced.aeron.idle-cpu-level = 1 ``` By setting this value to a lower number, it tells Akka to do longer "sleeping" periods on its thread dedicated diff --git a/akka-docs/src/main/paradox/remoting.md b/akka-docs/src/main/paradox/remoting.md index 5b4b30611a..bd2dfc75c2 100644 --- a/akka-docs/src/main/paradox/remoting.md +++ b/akka-docs/src/main/paradox/remoting.md @@ -1,4 +1,10 @@ -# Remoting +# Classic Remoting (Deprecated) + +@@@ warning + +Classic remoting has been deprecated and will be removed in Akka 2.7.0. Please use @ref[Artery](remoting-artery.md) instead. + +@@@ @@@ note @@ -35,7 +41,7 @@ akka { provider = remote } remote { - enabled-transports = ["akka.remote.netty.tcp"] + enabled-transports = ["akka.remote.classic.netty.tcp"] netty.tcp { hostname = "127.0.0.1" port = 2552 @@ -258,7 +264,7 @@ The list of allowed classes has to be configured on the "remote" system, in othe others will be attempting to remote deploy Actors. That system, locally, knows best which Actors it should or should not allow others to remote deploy onto it. The full settings section may for example look like this: -@@snip [RemoteDeploymentWhitelistSpec.scala](/akka-remote/src/test/scala/akka/remote/RemoteDeploymentWhitelistSpec.scala) { #whitelist-config } +@@snip [RemoteDeploymentWhitelistSpec.scala](/akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala) { #whitelist-config } Actor classes not included in the whitelist will not be allowed to be remote deployed onto this system. @@ -445,13 +451,13 @@ its multiple [known attack surfaces](https://community.hpe.com/t5/Security-Resea ### Configuring SSL/TLS for Akka Remoting -SSL can be used as the remote transport by adding `akka.remote.netty.ssl` to the `enabled-transport` configuration section. +SSL can be used as the remote transport by adding `akka.remote.classic.netty.ssl` to the `enabled-transport` configuration section. An example of setting up the default Netty based SSL driver as default: ``` akka { remote { - enabled-transports = [akka.remote.netty.ssl] + enabled-transports = [akka.remote.classic.netty.ssl] } } ``` diff --git a/akka-docs/src/main/paradox/security/2018-08-29-aes-rng.md b/akka-docs/src/main/paradox/security/2018-08-29-aes-rng.md index ffdd0e062b..3a27324626 100644 --- a/akka-docs/src/main/paradox/security/2018-08-29-aes-rng.md +++ b/akka-docs/src/main/paradox/security/2018-08-29-aes-rng.md @@ -28,7 +28,7 @@ configuration of the TLS random number generator should be used: ``` # Set `SecureRandom` RNG explicitly (but it is also the default) -akka.remote.netty.ssl.random-number-generator = "SecureRandom" +akka.remote.classic.netty.ssl.random-number-generator = "SecureRandom" akka.remote.artery.ssl.config-ssl-engine.random-number-generator = "SecureRandom" ``` diff --git a/akka-docs/src/test/java/jdocs/cluster/StatsSampleOneMasterMain.java b/akka-docs/src/test/java/jdocs/cluster/StatsSampleOneMasterMain.java index e64cac22db..2f554b97d7 100644 --- a/akka-docs/src/test/java/jdocs/cluster/StatsSampleOneMasterMain.java +++ b/akka-docs/src/test/java/jdocs/cluster/StatsSampleOneMasterMain.java @@ -30,7 +30,7 @@ public class StatsSampleOneMasterMain { for (String port : ports) { // Override the configuration of the port Config config = - ConfigFactory.parseString("akka.remote.netty.tcp.port=" + port) + ConfigFactory.parseString("akka.remote.classic.netty.tcp.port=" + port) .withFallback(ConfigFactory.parseString("akka.cluster.roles = [compute]")) .withFallback(ConfigFactory.load("stats2")); diff --git a/akka-docs/src/test/java/jdocs/remoting/RemoteDeploymentDocTest.java b/akka-docs/src/test/java/jdocs/remoting/RemoteDeploymentDocTest.java index 45b9b7ca16..88cc5bb4de 100644 --- a/akka-docs/src/test/java/jdocs/remoting/RemoteDeploymentDocTest.java +++ b/akka-docs/src/test/java/jdocs/remoting/RemoteDeploymentDocTest.java @@ -72,7 +72,7 @@ public class RemoteDeploymentDocTest extends AbstractJavaTest { @Test public void demonstrateProgrammaticConfig() { // #programmatic - ConfigFactory.parseString("akka.remote.netty.tcp.hostname=\"1.2.3.4\"") + ConfigFactory.parseString("akka.remote.classic.netty.tcp.hostname=\"1.2.3.4\"") .withFallback(ConfigFactory.load()); // #programmatic diff --git a/akka-docs/src/test/scala/docs/cluster/ClusterDocSpec.scala b/akka-docs/src/test/scala/docs/cluster/ClusterDocSpec.scala index 1a14293a67..b4eb553ed0 100644 --- a/akka-docs/src/test/scala/docs/cluster/ClusterDocSpec.scala +++ b/akka-docs/src/test/scala/docs/cluster/ClusterDocSpec.scala @@ -14,7 +14,7 @@ object ClusterDocSpec { val config = """ akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 """ } diff --git a/akka-docs/src/test/scala/docs/cluster/FactorialBackend.scala b/akka-docs/src/test/scala/docs/cluster/FactorialBackend.scala index 556f994957..a5c2e72a97 100644 --- a/akka-docs/src/test/scala/docs/cluster/FactorialBackend.scala +++ b/akka-docs/src/test/scala/docs/cluster/FactorialBackend.scala @@ -43,7 +43,7 @@ object FactorialBackend { // Override the configuration of the port when specified as program argument val port = if (args.isEmpty) "0" else args(0) val config = ConfigFactory - .parseString(s"akka.remote.netty.tcp.port=$port") + .parseString(s"akka.remote.classic.netty.tcp.port=$port") .withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]")) .withFallback(ConfigFactory.load("factorial")) diff --git a/akka-docs/src/test/scala/docs/cluster/TransformationBackend.scala b/akka-docs/src/test/scala/docs/cluster/TransformationBackend.scala index 0f16ad256d..50be487d7d 100644 --- a/akka-docs/src/test/scala/docs/cluster/TransformationBackend.scala +++ b/akka-docs/src/test/scala/docs/cluster/TransformationBackend.scala @@ -47,7 +47,7 @@ object TransformationBackend { // Override the configuration of the port when specified as program argument val port = if (args.isEmpty) "0" else args(0) val config = ConfigFactory - .parseString(s"akka.remote.netty.tcp.port=$port") + .parseString(s"akka.remote.classic.netty.tcp.port=$port") .withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]")) .withFallback(ConfigFactory.load()) diff --git a/akka-docs/src/test/scala/docs/cluster/TransformationFrontend.scala b/akka-docs/src/test/scala/docs/cluster/TransformationFrontend.scala index 336d6b0d92..e960110121 100644 --- a/akka-docs/src/test/scala/docs/cluster/TransformationFrontend.scala +++ b/akka-docs/src/test/scala/docs/cluster/TransformationFrontend.scala @@ -46,7 +46,7 @@ object TransformationFrontend { // Override the configuration of the port when specified as program argument val port = if (args.isEmpty) "0" else args(0) val config = ConfigFactory - .parseString(s"akka.remote.netty.tcp.port=$port") + .parseString(s"akka.remote.classic.netty.tcp.port=$port") .withFallback(ConfigFactory.parseString("akka.cluster.roles = [frontend]")) .withFallback(ConfigFactory.load()) diff --git a/akka-docs/src/test/scala/docs/ddata/DistributedDataDocSpec.scala b/akka-docs/src/test/scala/docs/ddata/DistributedDataDocSpec.scala index 7aa1900ae7..d1d17d61f0 100644 --- a/akka-docs/src/test/scala/docs/ddata/DistributedDataDocSpec.scala +++ b/akka-docs/src/test/scala/docs/ddata/DistributedDataDocSpec.scala @@ -19,7 +19,7 @@ object DistributedDataDocSpec { val config = """ akka.actor.provider = "cluster" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 #//#serializer-config akka.actor { diff --git a/akka-docs/src/test/scala/docs/remoting/RemoteDeploymentDocSpec.scala b/akka-docs/src/test/scala/docs/remoting/RemoteDeploymentDocSpec.scala index ccb871b06e..49d97db280 100644 --- a/akka-docs/src/test/scala/docs/remoting/RemoteDeploymentDocSpec.scala +++ b/akka-docs/src/test/scala/docs/remoting/RemoteDeploymentDocSpec.scala @@ -21,9 +21,8 @@ object RemoteDeploymentDocSpec { class RemoteDeploymentDocSpec extends AkkaSpec(""" akka.actor.provider = remote - akka.remote.netty.tcp { - port = 0 - } + akka.remote.classic.netty.tcp.port = 0 + akka.remote.artery.canonical.port = 0 """) with ImplicitSender { import RemoteDeploymentDocSpec._ diff --git a/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala b/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala index b4cda57c2d..80d923b1b2 100644 --- a/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala +++ b/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/MultiNodeSpec.scala @@ -110,7 +110,7 @@ abstract class MultiNodeConfig { private[akka] def config: Config = { val transportConfig = if (_testTransport) ConfigFactory.parseString(""" - akka.remote.netty.tcp.applied-adapters = [trttl, gremlin] + akka.remote.classic.netty.tcp.applied-adapters = [trttl, gremlin] akka.remote.artery.advanced.test-mode = on """) else ConfigFactory.empty @@ -214,8 +214,8 @@ object MultiNodeSpec { Map( "akka.actor.provider" -> "remote", "akka.remote.artery.canonical.hostname" -> selfName, - "akka.remote.netty.tcp.hostname" -> selfName, - "akka.remote.netty.tcp.port" -> selfPort, + "akka.remote.classic.netty.tcp.hostname" -> selfName, + "akka.remote.classic.netty.tcp.port" -> selfPort, "akka.remote.artery.canonical.port" -> selfPort)) private[testkit] val baseConfig: Config = @@ -495,7 +495,7 @@ abstract class MultiNodeSpec( */ protected def startNewSystem(): ActorSystem = { val config = ConfigFactory - .parseString(s"akka.remote.netty.tcp{port=${myAddress.port.get}\nhostname=${myAddress.host.get}}") + .parseString(s"akka.remote.classic.netty.tcp{port=${myAddress.port.get}\nhostname=${myAddress.host.get}}") .withFallback(system.settings.config) val sys = ActorSystem(system.name, config) injectDeployments(sys, myself) diff --git a/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/PersistencePluginProxySpec.scala b/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/PersistencePluginProxySpec.scala index c9f91fe10c..66516c20ee 100644 --- a/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/PersistencePluginProxySpec.scala +++ b/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/PersistencePluginProxySpec.scala @@ -29,8 +29,12 @@ object PersistencePluginProxySpec { } } remote { - enabled-transports = ["akka.remote.netty.tcp"] - netty.tcp { + enabled-transports = ["akka.remote.classic.netty.tcp"] + classic.netty.tcp { + hostname = "127.0.0.1" + port = 0 + } + artery.canonical { hostname = "127.0.0.1" port = 0 } diff --git a/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala b/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala index 723e0b349d..7330e56fc1 100644 --- a/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala +++ b/akka-persistence-shared/src/test/scala/akka/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala @@ -26,8 +26,12 @@ object SharedLeveldbJournalSpec { } } remote { - enabled-transports = ["akka.remote.netty.tcp"] - netty.tcp { + enabled-transports = ["akka.remote.classic.netty.tcp"] + classic.netty.tcp { + hostname = "127.0.0.1" + port = 0 + } + artery.canonical { hostname = "127.0.0.1" port = 0 } diff --git a/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala b/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala index 8c8f8c3f08..884f7db3a1 100644 --- a/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala +++ b/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala @@ -46,8 +46,12 @@ object SerializerSpecConfigs { provider = remote } remote { - enabled-transports = ["akka.remote.netty.tcp"] - netty.tcp { + enabled-transports = ["akka.remote.classic.netty.tcp"] + classic.netty.tcp { + hostname = "127.0.0.1" + port = 0 + } + artery.canonical { hostname = "127.0.0.1" port = 0 } @@ -296,7 +300,7 @@ class MessageSerializerPersistenceSpec extends AkkaSpec(customSerializers) { object MessageSerializerRemotingSpec { class LocalActor(port: Int) extends Actor { def receive = { - case m => context.actorSelection(s"akka.tcp://remote@127.0.0.1:${port}/user/remote").tell(m, Actor.noSender) + case m => context.actorSelection(s"akka://remote@127.0.0.1:${port}/user/remote").tell(m, Actor.noSender) } } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala index cf3ab1186d..dc180b4f9b 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala @@ -27,8 +27,8 @@ class RemoteNodeRestartDeathWatchConfig(artery: Boolean) extends MultiNodeConfig commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString(s""" akka.loglevel = INFO akka.remote.log-remote-lifecycle-events = off - akka.remote.transport-failure-detector.heartbeat-interval = 1 s - akka.remote.transport-failure-detector.acceptable-heartbeat-pause = 3 s + akka.remote.classic.transport-failure-detector.heartbeat-interval = 1 s + akka.remote.classic.transport-failure-detector.acceptable-heartbeat-pause = 3 s akka.remote.artery.enabled = $artery """))) @@ -110,7 +110,7 @@ abstract class RemoteNodeRestartDeathWatchSpec(multiNodeConfig: RemoteNodeRestar val freshSystem = ActorSystem( system.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${address.port.get} + akka.remote.classic.netty.tcp.port = ${address.port.get} akka.remote.artery.canonical.port = ${address.port.get} """).withFallback(system.settings.config)) freshSystem.actorOf(Props[Subject], "subject") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala index 66bd3af717..20f3b77aa6 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala @@ -111,7 +111,7 @@ abstract class RemoteQuarantinePiercingSpec(multiNodeConfig: RemoteQuarantinePie val freshSystem = ActorSystem( system.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${address.port.get} + akka.remote.classic.netty.tcp.port = ${address.port.get} akka.remote.artery.canonical.port = ${address.port.get} """).withFallback(system.settings.config)) freshSystem.actorOf(Props[Subject], "subject") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala index 2f63c8ae58..921bdea5ec 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala @@ -24,7 +24,7 @@ class RemoteReDeploymentConfig(artery: Boolean) extends MultiNodeConfig { val second = role("second") commonConfig( - debugConfig(on = true).withFallback(ConfigFactory.parseString(s"""akka.remote.transport-failure-detector { + debugConfig(on = false).withFallback(ConfigFactory.parseString(s"""akka.remote.classic.transport-failure-detector { threshold=0.1 heartbeat-interval=0.1s acceptable-heartbeat-pause=1s diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala index 0f0470a6b3..79429a44f9 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala @@ -27,7 +27,7 @@ object TransportFailConfig extends MultiNodeConfig { commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString(s""" akka.loglevel = INFO - akka.remote { + akka.remote.classic { transport-failure-detector { implementation-class = "akka.remote.TransportFailSpec$$TestFailureDetector" heartbeat-interval = 1 s diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/BenchmarkFileReporter.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/BenchmarkFileReporter.scala index 196f00c0b8..cafd6b7a38 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/BenchmarkFileReporter.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/BenchmarkFileReporter.scala @@ -60,9 +60,9 @@ object BenchmarkFileReporter { "akka.test.LatencySpec.real-message", "akka.remote.artery.enabled", "akka.remote.artery.advanced.inbound-lanes", - "akka.remote.artery.advanced.idle-cpu-level", "akka.remote.artery.advanced.buffer-pool-size", - "akka.remote.artery.advanced.embedded-media-driver", + "akka.remote.artery.advanced.aeron.idle-cpu-level", + "akka.remote.artery.advanced.aeron.embedded-media-driver", "akka.remote.default-remote-dispatcher.throughput", "akka.remote.default-remote-dispatcher.fork-join-executor.parallelism-factor", "akka.remote.default-remote-dispatcher.fork-join-executor.parallelism-min", diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala index 4b08ca8a2f..cedc7032bc 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala @@ -50,10 +50,10 @@ object LatencySpec extends MultiNodeConfig { # for serious measurements when running this test on only one machine # it is recommended to use external media driver # See akka-remote/src/test/resources/aeron.properties - # advanced.embedded-media-driver = off - # advanced.aeron-dir = "akka-remote/target/aeron" + # advanced.aeron.embedded-media-driver = off + # advanced.aeron.aeron-dir = "akka-remote/target/aeron" # on linux, use directory on ram disk, instead - # advanced.aeron-dir = "/dev/shm/aeron" + # advanced.aeron.aeron-dir = "/dev/shm/aeron" advanced.compression { actor-refs.advertisement-interval = 2 second diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/MaxThroughputSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/MaxThroughputSpec.scala index c18c68a67a..7990f8ac8e 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/MaxThroughputSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/MaxThroughputSpec.scala @@ -57,10 +57,10 @@ object MaxThroughputSpec extends MultiNodeConfig { # for serious measurements when running this test on only one machine # it is recommended to use external media driver # See akka-remote/src/test/resources/aeron.properties - # advanced.embedded-media-driver = off - # advanced.aeron-dir = "akka-remote/target/aeron" + # advanced.aeron.embedded-media-driver = off + # advanced.aeron.aeron-dir = "akka-remote/target/aeron" # on linux, use directory on ram disk, instead - # advanced.aeron-dir = "/dev/shm/aeron" + # advanced.aeron.aeron-dir = "/dev/shm/aeron" advanced.compression { actor-refs.advertisement-interval = 2 second diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala index be52a35801..d5ba148d6d 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala @@ -64,7 +64,7 @@ abstract class AeronStreamConsistencySpec Aeron.connect(ctx) } - val idleCpuLevel = system.settings.config.getInt("akka.remote.artery.advanced.idle-cpu-level") + val idleCpuLevel = system.settings.config.getInt("akka.remote.artery.advanced.aeron.idle-cpu-level") val taskRunner = { val r = new TaskRunner(system.asInstanceOf[ExtendedActorSystem], idleCpuLevel) r.start() diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala index d32411c4ed..bc908e26f4 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala @@ -96,7 +96,7 @@ abstract class AeronStreamMaxThroughputSpec Aeron.connect(ctx) } - val idleCpuLevel = system.settings.config.getInt("akka.remote.artery.advanced.idle-cpu-level") + val idleCpuLevel = system.settings.config.getInt("akka.remote.artery.advanced.aeron.idle-cpu-level") val taskRunner = { val r = new TaskRunner(system.asInstanceOf[ExtendedActorSystem], idleCpuLevel) r.start() diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteGatePiercingSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteGatePiercingSpec.scala similarity index 78% rename from akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteGatePiercingSpec.scala rename to akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteGatePiercingSpec.scala index cadad6c606..b134bc5103 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteGatePiercingSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteGatePiercingSpec.scala @@ -2,37 +2,36 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic -import akka.remote.transport.AssociationHandle - -import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import akka.actor._ +import akka.actor.{ ActorIdentity, Identify, _ } import akka.remote.testconductor.RoleName -import akka.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly import akka.remote.testkit.MultiNodeConfig +import akka.remote.transport.AssociationHandle +import akka.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly +import akka.remote.{ RARP, RemotingMultiNodeSpec } import akka.testkit._ -import akka.actor.ActorIdentity -import akka.remote.testconductor.RoleName -import akka.actor.Identify +import com.typesafe.config.ConfigFactory + import scala.concurrent.Await +import scala.concurrent.duration._ object RemoteGatePiercingSpec extends MultiNodeConfig { val first = role("first") val second = role("second") commonConfig( - debugConfig(on = false) - .withFallback(ConfigFactory.parseString(""" + debugConfig(on = false).withFallback( + ConfigFactory.parseString(""" akka.loglevel = INFO - akka.remote.log-remote-lifecycle-events = INFO - akka.remote.transport-failure-detector.acceptable-heartbeat-pause = 5 s + akka.remote.artery.enabled = false + akka.remote.classic.log-remote-lifecycle-events = INFO + akka.remote.classic.transport-failure-detector.acceptable-heartbeat-pause = 5 s """))) - nodeConfig(first)(ConfigFactory.parseString("akka.remote.retry-gate-closed-for = 1 d # Keep it long")) + nodeConfig(first)(ConfigFactory.parseString("akka.remote.classic.retry-gate-closed-for = 1 d # Keep it long")) - nodeConfig(second)(ConfigFactory.parseString("akka.remote.retry-gate-closed-for = 1 s # Keep it short")) + nodeConfig(second)(ConfigFactory.parseString("akka.remote.classic.retry-gate-closed-for = 1 s # Keep it short")) testTransport(on = true) diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartGateSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeRestartGateSpec.scala similarity index 91% rename from akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartGateSpec.scala rename to akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeRestartGateSpec.scala index 7134430b1b..6c5d9c7dbd 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartGateSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeRestartGateSpec.scala @@ -2,21 +2,19 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic -import akka.remote.transport.AssociationHandle - -import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import akka.actor._ +import akka.actor.{ ActorIdentity, Identify, _ } import akka.remote.testconductor.RoleName -import akka.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly import akka.remote.testkit.MultiNodeConfig +import akka.remote.transport.AssociationHandle +import akka.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly +import akka.remote.{ RARP, RemotingMultiNodeSpec } import akka.testkit._ -import akka.actor.ActorIdentity -import akka.remote.testconductor.RoleName -import akka.actor.Identify +import com.typesafe.config.ConfigFactory + import scala.concurrent.Await +import scala.concurrent.duration._ object RemoteNodeRestartGateSpec extends MultiNodeConfig { val first = role("first") @@ -25,9 +23,10 @@ object RemoteNodeRestartGateSpec extends MultiNodeConfig { commonConfig( debugConfig(on = false) .withFallback(ConfigFactory.parseString(""" + akka.remote.artery.enabled = off akka.loglevel = INFO - akka.remote.log-remote-lifecycle-events = INFO - akka.remote.retry-gate-closed-for = 1d # Keep it long + akka.remote.classic.log-remote-lifecycle-events = INFO + akka.remote.classic.retry-gate-closed-for = 1d # Keep it long """))) testTransport(on = true) @@ -100,7 +99,7 @@ abstract class RemoteNodeRestartGateSpec extends RemotingMultiNodeSpec(RemoteNod system.name, ConfigFactory.parseString(s""" akka.remote.retry-gate-closed-for = 0.5 s - akka.remote.netty.tcp { + akka.remote.classic.netty.tcp { hostname = ${address.host.get} port = ${address.port.get} } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeShutdownAndComesBackSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala similarity index 90% rename from akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeShutdownAndComesBackSpec.scala rename to akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala index c238a43c4c..1c9ecd6eaa 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeShutdownAndComesBackSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala @@ -2,20 +2,19 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic -import language.postfixOps -import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import akka.actor._ +import akka.actor.{ ActorIdentity, Identify, _ } import akka.remote.testconductor.RoleName -import akka.remote.transport.ThrottlerTransportAdapter.{ Direction, ForceDisassociate } import akka.remote.testkit.MultiNodeConfig +import akka.remote.transport.ThrottlerTransportAdapter.{ Direction, ForceDisassociate } +import akka.remote.{ RARP, RemotingMultiNodeSpec } import akka.testkit._ -import akka.actor.ActorIdentity -import akka.remote.testconductor.RoleName -import akka.actor.Identify +import com.typesafe.config.ConfigFactory + import scala.concurrent.Await +import scala.concurrent.duration._ +import scala.language.postfixOps object RemoteNodeShutdownAndComesBackSpec extends MultiNodeConfig { val first = role("first") @@ -25,10 +24,11 @@ object RemoteNodeShutdownAndComesBackSpec extends MultiNodeConfig { debugConfig(on = false).withFallback( ConfigFactory.parseString(""" akka.loglevel = INFO - akka.remote.log-remote-lifecycle-events = INFO + akka.remote.artery.enabled = off + akka.remote.classic.log-remote-lifecycle-events = INFO ## Keep it tight, otherwise reestablishing a connection takes too much time - akka.remote.transport-failure-detector.heartbeat-interval = 1 s - akka.remote.transport-failure-detector.acceptable-heartbeat-pause = 3 s + akka.remote.classic.transport-failure-detector.heartbeat-interval = 1 s + akka.remote.classic.transport-failure-detector.acceptable-heartbeat-pause = 3 s akka.remote.watch-failure-detector.acceptable-heartbeat-pause = 60 s """))) @@ -81,6 +81,7 @@ abstract class RemoteNodeShutdownAndComesBackSpec extends RemotingMultiNodeSpec( // Drop all messages from this point so no SHUTDOWN is ever received testConductor.blackhole(second, first, Direction.Send).await // Shut down all existing connections so that the system can enter recovery mode (association attempts) + // TODO, should artery support this? Await.result( RARP(system).provider.transport.managementCommand(ForceDisassociate(node(second).address)), 3.seconds) @@ -136,7 +137,7 @@ abstract class RemoteNodeShutdownAndComesBackSpec extends RemotingMultiNodeSpec( val freshSystem = ActorSystem( system.name, ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${address.port.get} + akka.remote.classic.netty.tcp.port = ${address.port.get} akka.remote.artery.canonical.port = ${address.port.get} """).withFallback(system.settings.config)) freshSystem.actorOf(Props[Subject], "subject") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteRestartedQuarantinedSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteRestartedQuarantinedSpec.scala similarity index 88% rename from akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteRestartedQuarantinedSpec.scala rename to akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteRestartedQuarantinedSpec.scala index 79ae09ac27..b95d63a04e 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteRestartedQuarantinedSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteRestartedQuarantinedSpec.scala @@ -2,19 +2,18 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic -import language.postfixOps -import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import akka.actor._ +import akka.actor.{ ActorIdentity, Identify, _ } import akka.remote.testconductor.RoleName import akka.remote.testkit.MultiNodeConfig +import akka.remote.{ AddressUidExtension, RARP, RemotingMultiNodeSpec, ThisActorSystemQuarantinedEvent } import akka.testkit._ -import akka.actor.ActorIdentity -import akka.remote.testconductor.RoleName -import akka.actor.Identify +import com.typesafe.config.ConfigFactory + import scala.concurrent.Await +import scala.concurrent.duration._ +import scala.language.postfixOps object RemoteRestartedQuarantinedSpec extends MultiNodeConfig { val first = role("first") @@ -23,16 +22,17 @@ object RemoteRestartedQuarantinedSpec extends MultiNodeConfig { commonConfig( debugConfig(on = false).withFallback(ConfigFactory.parseString( """ + akka.remote.artery.enabled = off # Keep it long, we don't want reconnects - akka.remote.retry-gate-closed-for = 1 s + akka.remote.classic.retry-gate-closed-for = 1 s # Important, otherwise it is very racy to get a non-writing endpoint: the only way to do it if the two nodes # associate to each other at the same time. Setting this will ensure that the right scenario happens. - akka.remote.use-passive-connections = off + akka.remote.classic.use-passive-connections = off # TODO should not be needed, but see TODO at the end of the test - akka.remote.transport-failure-detector.heartbeat-interval = 1 s - akka.remote.transport-failure-detector.acceptable-heartbeat-pause = 10 s + akka.remote.classic.transport-failure-detector.heartbeat-interval = 1 s + akka.remote.classic.transport-failure-detector.acceptable-heartbeat-pause = 10 s """))) testTransport(on = true) @@ -119,7 +119,7 @@ abstract class RemoteRestartedQuarantinedSpec extends RemotingMultiNodeSpec(Remo system.name, ConfigFactory.parseString(s""" akka.remote.retry-gate-closed-for = 0.5 s - akka.remote.netty.tcp { + akka.remote.classic.netty.tcp { hostname = ${address.host.get} port = ${address.port.get} } @@ -132,7 +132,7 @@ abstract class RemoteRestartedQuarantinedSpec extends RemotingMultiNodeSpec(Remo freshSystem .actorSelection(RootActorPath(firstAddress) / "user" / "subject") .tell(Identify("subject"), probe.ref) - probe.expectMsgType[ActorIdentity](1.second).ref should not be (None) + probe.expectMsgType[ActorIdentity](1.second).ref should not be None }, 30.seconds) diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/Ticket15109Spec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/Ticket15109Spec.scala similarity index 84% rename from akka-remote-tests/src/multi-jvm/scala/akka/remote/Ticket15109Spec.scala rename to akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/Ticket15109Spec.scala index cd529e0205..bfbddb3d1a 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/Ticket15109Spec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/Ticket15109Spec.scala @@ -2,20 +2,19 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic -import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import akka.actor._ +import akka.actor.{ ActorIdentity, Identify, _ } import akka.remote.testconductor.RoleName -import akka.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly import akka.remote.testkit.MultiNodeConfig -import akka.testkit._ -import akka.actor.ActorIdentity -import akka.remote.testconductor.RoleName -import akka.actor.Identify -import scala.concurrent.Await import akka.remote.transport.AssociationHandle +import akka.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly +import akka.remote.{ RARP, RemotingMultiNodeSpec } +import akka.testkit._ +import com.typesafe.config.ConfigFactory + +import scala.concurrent.Await +import scala.concurrent.duration._ object Ticket15109Spec extends MultiNodeConfig { val first = role("first") @@ -25,11 +24,12 @@ object Ticket15109Spec extends MultiNodeConfig { debugConfig(on = false).withFallback( ConfigFactory.parseString(""" akka.loglevel = INFO - akka.remote.log-remote-lifecycle-events = INFO + akka.remote.artery.enabled = off + akka.remote.classic.log-remote-lifecycle-events = INFO ## Keep it tight, otherwise reestablishing a connection takes too much time - akka.remote.transport-failure-detector.heartbeat-interval = 1 s - akka.remote.transport-failure-detector.acceptable-heartbeat-pause = 3 s - akka.remote.retry-gate-closed-for = 0.5 s + akka.remote.classic.transport-failure-detector.heartbeat-interval = 1 s + akka.remote.classic.transport-failure-detector.acceptable-heartbeat-pause = 3 s + akka.remote.classic.retry-gate-closed-for = 0.5 s """))) testTransport(on = true) diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala index e65e8807ef..9369ee8ffc 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala @@ -9,13 +9,15 @@ import akka.actor.{ Actor, ActorIdentity, Deploy, Identify, Props } import scala.concurrent.duration._ import akka.testkit.LongRunningTest - import akka.remote.RemotingMultiNodeSpec import akka.remote.testkit.MultiNodeConfig import akka.remote.transport.ThrottlerTransportAdapter.Direction +import com.typesafe.config.ConfigFactory object TestConductorMultiJvmSpec extends MultiNodeConfig { - commonConfig(debugConfig(on = false).withFallback(RemotingMultiNodeSpec.commonConfig)) + commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString(""" + akka.remote.artery.enabled = false + """)).withFallback(RemotingMultiNodeSpec.commonConfig)) val master = role("master") val slave = role("slave") diff --git a/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala index 39160dc547..ff3debb442 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala @@ -27,7 +27,7 @@ class ArteryFailedToBindSpec extends WordSpec with Matchers { | enabled = on | canonical.hostname = "127.0.0.1" | canonical.port = $port - | log-aeron-counters = on + | aeron.log-aeron-counters = on | } | } |} diff --git a/akka-remote-tests/src/test/scala/akka/remote/RemotingFailedToBindSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/classic/RemotingFailedToBindSpec.scala similarity index 91% rename from akka-remote-tests/src/test/scala/akka/remote/RemotingFailedToBindSpec.scala rename to akka-remote-tests/src/test/scala/akka/remote/classic/RemotingFailedToBindSpec.scala index 1343eb8368..45efc789f7 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/RemotingFailedToBindSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/classic/RemotingFailedToBindSpec.scala @@ -2,7 +2,7 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic import akka.actor.ActorSystem import akka.testkit.SocketUtil @@ -20,7 +20,8 @@ class RemotingFailedToBindSpec extends WordSpec with Matchers { | actor { | provider = remote | } - | remote { + | remote.artery.enabled = off + | remote.classic { | netty.tcp { | hostname = "127.0.0.1" | port = $port diff --git a/akka-remote/src/main/mima-filters/2.5.x.backwards.excludes b/akka-remote/src/main/mima-filters/2.5.x.backwards.excludes new file mode 100644 index 0000000000..83deab3aec --- /dev/null +++ b/akka-remote/src/main/mima-filters/2.5.x.backwards.excludes @@ -0,0 +1,21 @@ +# Make artery default and remove netty udp #26179 +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.UdpClientHandler") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.transport.netty.NettyTransportSettings.TransportMode") +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.NettyTransportSettings$Mode") +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.NettyTransportSettings$Udp$") +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.NettyTransportSettings$Tcp$") +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.UdpAssociationHandle") +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.NettyTransportSettings$") +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.UdpHandlers") +ProblemFilters.exclude[MissingClassProblem]("akka.remote.transport.netty.UdpServerHandler") +# Make artery default and remove netty udp #26179 - restructuring advanced configuration +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.IdleCpuLevel") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.GiveUpMessageAfter") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.AeronDirectoryName") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.EmbeddedMediaDriver") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.DeleteAeronDirectory") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.ClientLivenessTimeout") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.ImageLivenessTimeout") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.DriverTimeout") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings#Advanced.ConnectionTimeout") +ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.artery.ArterySettings.LogAeronCounters") diff --git a/akka-remote/src/main/resources/reference.conf b/akka-remote/src/main/resources/reference.conf index b32f049752..988f3ab37e 100644 --- a/akka-remote/src/main/resources/reference.conf +++ b/akka-remote/src/main/resources/reference.conf @@ -129,9 +129,9 @@ akka { # Additional serialization bindings which are enabled automatically when allow-java-serialization is disabled. java-serialization-disabled-additional-serialization-bindings = { - "akka.Done" = akka-misc - "akka.NotUsed" = akka-misc - "akka.actor.Address" = akka-misc + "akka.Done" = akka-misc + "akka.NotUsed" = akka-misc + "akka.actor.Address" = akka-misc "akka.remote.UniqueAddress" = akka-misc } @@ -183,38 +183,6 @@ akka { # warning. warn-about-direct-use = "on" - # If set to a nonempty string remoting will use the given dispatcher for - # its internal actors otherwise the default dispatcher is used. Please note - # that since remoting can load arbitrary 3rd party drivers (see - # "enabled-transport" and "adapters" entries) it is not guaranteed that - # every module will respect this setting. - use-dispatcher = "akka.remote.default-remote-dispatcher" - - # Settings for the failure detector to monitor connections. - # For TCP it is not important to have fast failure detection, since - # most connection failures are captured by TCP itself. - # The default DeadlineFailureDetector will trigger if there are no heartbeats within - # the duration heartbeat-interval + acceptable-heartbeat-pause, i.e. 124 seconds - # with the default settings. - transport-failure-detector { - - # FQCN of the failure detector implementation. - # It must implement akka.remote.FailureDetector and have - # a public constructor with a com.typesafe.config.Config and - # akka.actor.EventStream parameter. - implementation-class = "akka.remote.DeadlineFailureDetector" - - # How often keep-alive heartbeat messages should be sent to each connection. - heartbeat-interval = 4 s - - # Number of potentially lost/delayed heartbeats that will be - # accepted before considering it to be an anomaly. - # A margin to the `heartbeat-interval` is important to be able to survive sudden, - # occasional, pauses in heartbeat arrivals, due to for example garbage collect or - # network drop. - acceptable-heartbeat-pause = 120 s - } - # Settings for the Phi accrual failure detector (http://www.jaist.ac.jp/~defago/files/pdf/IS_RR_2004_010.pdf # [Hayashibara et al]) used for remote death watch. # The default PhiAccrualFailureDetector will trigger if there are no heartbeats within @@ -274,17 +242,63 @@ akka { whitelist = [] } -#//#shared + + ### Default dispatcher for the remoting subsystem + default-remote-dispatcher { + type = Dispatcher + executor = "fork-join-executor" + fork-join-executor { + parallelism-min = 2 + parallelism-factor = 0.5 + parallelism-max = 16 + } + throughput = 10 + } + #//#shared } } akka { - remote { -#//#classic + remote.classic { + #//#classic + + ### Configuration for classic remoting. Classic remoting is deprecated, use artery. + + + # If set to a nonempty string remoting will use the given dispatcher for + # its internal actors otherwise the default dispatcher is used. Please note + # that since remoting can load arbitrary 3rd party drivers (see + # "enabled-transport" and "adapters" entries) it is not guaranteed that + # every module will respect this setting. + use-dispatcher = "akka.remote.default-remote-dispatcher" + + # Settings for the failure detector to monitor connections. + # For TCP it is not important to have fast failure detection, since + # most connection failures are captured by TCP itself. + # The default DeadlineFailureDetector will trigger if there are no heartbeats within + # the duration heartbeat-interval + acceptable-heartbeat-pause, i.e. 124 seconds + # with the default settings. + transport-failure-detector { + + # FQCN of the failure detector implementation. + # It must implement akka.remote.FailureDetector and have + # a public constructor with a com.typesafe.config.Config and + # akka.actor.EventStream parameter. + implementation-class = "akka.remote.DeadlineFailureDetector" + + # How often keep-alive heartbeat messages should be sent to each connection. + heartbeat-interval = 4 s + + # Number of potentially lost/delayed heartbeats that will be + # accepted before considering it to be an anomaly. + # A margin to the `heartbeat-interval` is important to be able to survive sudden, + # occasional, pauses in heartbeat arrivals, due to for example garbage collect or + # network drop. + acceptable-heartbeat-pause = 120 s + } - ### Configuration for classic remoting # Timeout after which the startup of the remoting subsystem is considered # to be failed. Increase this value if your transport drivers (see the @@ -313,7 +327,7 @@ akka { command-ack-timeout = 30 s # The timeout for outbound associations to perform the handshake. - # If the transport is akka.remote.netty.tcp or akka.remote.netty.ssl + # If the transport is akka.remote.classic.netty.tcp or akka.remote.classic.netty.ssl # the configured connection-timeout for the transport will be used instead. handshake-timeout = 15 s @@ -453,7 +467,7 @@ akka { # pointing to an implementation class of the Transport interface. # If multiple transports are provided, the address of the first # one will be used as a default address. - enabled-transports = ["akka.remote.netty.tcp"] + enabled-transports = ["akka.remote.classic.netty.tcp"] # Transport drivers can be augmented with adapters by adding their # name to the applied-adapters setting in the configuration of a @@ -483,8 +497,6 @@ akka { # Akka protocol applied-adapters = [] - transport-protocol = tcp - # The default remote server port clients should connect to. # Default is 2552 (AKKA), use 0 if you want a random available port # This port needs to be unique for each actor system on the same machine. @@ -499,38 +511,38 @@ akka { # when running akka nodes in a separated networks (under NATs or docker containers). # Use 0 if you want a random available port. Examples: # - # akka.remote.netty.tcp.port = 2552 - # akka.remote.netty.tcp.bind-port = 2553 + # akka.remote.classic.netty.tcp.port = 2552 + # akka.remote.classic.netty.tcp.bind-port = 2553 # Network interface will be bound to the 2553 port, but remoting protocol will # expect messages sent to port 2552. # - # akka.remote.netty.tcp.port = 0 - # akka.remote.netty.tcp.bind-port = 0 + # akka.remote.classic.netty.tcp.port = 0 + # akka.remote.classic.netty.tcp.bind-port = 0 # Network interface will be bound to a random port, and remoting protocol will # expect messages sent to the bound port. # - # akka.remote.netty.tcp.port = 2552 - # akka.remote.netty.tcp.bind-port = 0 + # akka.remote.classic.netty.tcp.port = 2552 + # akka.remote.classic.netty.tcp.bind-port = 0 # Network interface will be bound to a random port, but remoting protocol will # expect messages sent to port 2552. # - # akka.remote.netty.tcp.port = 0 - # akka.remote.netty.tcp.bind-port = 2553 + # akka.remote.classic.netty.tcp.port = 0 + # akka.remote.classic.netty.tcp.bind-port = 2553 # Network interface will be bound to the 2553 port, and remoting protocol will # expect messages sent to the bound port. # - # akka.remote.netty.tcp.port = 2552 - # akka.remote.netty.tcp.bind-port = "" + # akka.remote.classic.netty.tcp.port = 2552 + # akka.remote.classic.netty.tcp.bind-port = "" # Network interface will be bound to the 2552 port, and remoting protocol will # expect messages sent to the bound port. # - # akka.remote.netty.tcp.port if empty + # akka.remote.classic.netty.tcp.port if empty bind-port = "" # Use this setting to bind a network interface to a different hostname or ip # than remoting protocol expects messages at. # Use "0.0.0.0" to bind to all interfaces. - # akka.remote.netty.tcp.hostname if empty + # akka.remote.classic.netty.tcp.hostname if empty bind-hostname = "" # Enables SSL support on this transport @@ -621,15 +633,7 @@ akka { } - # DEPRECATED, since 2.5.0 - # The netty.udp transport is deprecated, please use Artery instead. - # See: https://doc.akka.io/docs/akka/current/remoting-artery.html - netty.udp = ${akka.remote.netty.tcp} - netty.udp { - transport-protocol = udp - } - - netty.ssl = ${akka.remote.netty.tcp} + netty.ssl = ${akka.remote.classic.netty.tcp} netty.ssl = { # Enable SSL/TLS encryption. # This must be enabled on both the client and server to work. @@ -639,7 +643,7 @@ akka { # Must implement akka.remote.transport.netty.SSLEngineProvider and have a public # constructor with an ActorSystem parameter. # The default ConfigSSLEngineProvider is configured by properties in section - # akka.remote.netty.ssl.security + # akka.remote.classic.netty.ssl.security # # The SSLEngineProvider can also be defined via ActorSystemSetup with # SSLEngineProviderSetup when starting the ActorSystem. That is useful when @@ -714,19 +718,6 @@ akka { debug = off } - ### Default dispatcher for the remoting subsystem - - default-remote-dispatcher { - type = Dispatcher - executor = "fork-join-executor" - fork-join-executor { - parallelism-min = 2 - parallelism-factor = 0.5 - parallelism-max = 16 - } - throughput = 10 - } - backoff-remote-dispatcher { type = Dispatcher executor = "fork-join-executor" @@ -740,33 +731,23 @@ akka { } #//#classic +#//#artery akka { remote { - #//#artery ### Configuration for Artery, the new implementation of remoting artery { - # Enable the new remoting with this flag - enabled = off + # Disable artery with this flag + enabled = on # Select the underlying transport implementation. # # Possible values: aeron-udp, tcp, tls-tcp - # - # The Aeron (UDP) transport is a high performance transport and should be used for systems - # that require high throughput and low latency. It is using more CPU than TCP when the - # system is idle or at low message rates. There is no encryption for Aeron. - # https://github.com/real-logic/aeron - # - # The TCP and TLS transport is implemented using Akka Streams TCP/TLS. This is the choice - # when encryption is needed, but it can also be used with plain TCP without TLS. It's also - # the obvious choice when UDP can't be used. - # It has very good performance (high throughput and low latency) but latency at high throughput - # might not be as good as the Aeron transport. - # It is using less CPU than Aeron when the system is idle or at low message rates. - transport = aeron-udp + # See https://doc.akka.io/docs/akka/current/remoting-artery.html#selecting-a-transport for the tradeoffs + # for each transport + transport = tcp # Canonical address is the address other clients should connect to. # Artery transport will expect messages to this address. @@ -812,9 +793,6 @@ akka { bind-timeout = 3s } - # Periodically log out all Aeron counters. See https://github.com/real-logic/aeron/wiki/Monitoring-and-Debugging#counters - # Only used when transport is aeron-udp. - log-aeron-counters = false # Actor paths to use the large message stream for when a message # is sent to them over remoting. The large message stream dedicated @@ -895,31 +873,6 @@ akka { # are not disturbed. use-control-stream-dispatcher = "" - # Controls whether to start the Aeron media driver in the same JVM or use external - # process. Set to 'off' when using external media driver, and then also set the - # 'aeron-dir'. - # Only used when transport is aeron-udp. - embedded-media-driver = on - - # Directory used by the Aeron media driver. It's mandatory to define the 'aeron-dir' - # if using external media driver, i.e. when 'embedded-media-driver = off'. - # Embedded media driver will use a this directory, or a temporary directory if this - # property is not defined (empty). - # Only used when transport is aeron-udp. - aeron-dir = "" - - # Whether to delete aeron embedded driver directory upon driver stop. - # Only used when transport is aeron-udp. - delete-aeron-dir = yes - - # Level of CPU time used, on a scale between 1 and 10, during backoff/idle. - # The tradeoff is that to have low latency more CPU time must be used to be - # able to react quickly on incoming messages or send as fast as possible after - # backoff backpressure. - # Level 1 strongly prefer low CPU consumption over low latency. - # Level 10 strongly prefer low latency over low CPU consumption. - # Only used when transport is aeron-udp. - idle-cpu-level = 5 # Total number of inbound lanes, shared among all inbound associations. A value # greater than 1 means that deserialization can be performed in parallel for @@ -970,9 +923,7 @@ akka { # unacknowledged system messages are re-delivered with this interval system-message-resend-interval = 1 second - # Timeout of establishing outbound connections. - # Only used when transport is tcp or tls-tcp. - connection-timeout = 5 seconds + # The timeout for outbound associations to perform the initial handshake. # This timeout must be greater than the 'image-liveness-timeout' when @@ -987,9 +938,6 @@ akka { # a new session with a restarted destination system. inject-handshake-interval = 1 second - # messages that are not accepted by Aeron are dropped after retrying for this period - # Only used when transport is aeron-udp. - give-up-message-after = 60 seconds # System messages that are not acknowledged after re-sending for this period are # dropped and will trigger quarantine. The value should be longer than the length @@ -1051,24 +999,9 @@ akka { # If more restarts occurs the ActorSystem will be terminated. outbound-max-restarts = 5 - # Timeout after which aeron driver has not had keepalive messages - # from a client before it considers the client dead. - # Only used when transport is aeron-udp. - client-liveness-timeout = 20 seconds - # Timeout for each the INACTIVE and LINGER stages an aeron image - # will be retained for when it is no longer referenced. - # This timeout must be less than the 'handshake-timeout'. - # Only used when transport is aeron-udp. - image-liveness-timeout = 10 seconds - - # Timeout after which the aeron driver is considered dead - # if it does not update its C'n'C timestamp. - # Only used when transport is aeron-udp. - driver-timeout = 20 seconds flight-recorder { - // FIXME it should be enabled by default when we have a good solution for naming the files enabled = off # Controls where the flight recorder file will be written. There are three options: # 1. Empty: a file will be generated in the temporary directory of the OS @@ -1117,6 +1050,66 @@ akka { # Refer to `akka.remote.artery.RemoteInstrument` for more information. instruments = ${?akka.remote.artery.advanced.instruments} [] + # Only used when transport is aeron-udp + aeron { + # Periodically log out all Aeron counters. See https://github.com/real-logic/aeron/wiki/Monitoring-and-Debugging#counters + # Only used when transport is aeron-udp. + log-aeron-counters = false + + # Controls whether to start the Aeron media driver in the same JVM or use external + # process. Set to 'off' when using external media driver, and then also set the + # 'aeron-dir'. + # Only used when transport is aeron-udp. + embedded-media-driver = on + + # Directory used by the Aeron media driver. It's mandatory to define the 'aeron-dir' + # if using external media driver, i.e. when 'embedded-media-driver = off'. + # Embedded media driver will use a this directory, or a temporary directory if this + # property is not defined (empty). + # Only used when transport is aeron-udp. + aeron-dir = "" + + # Whether to delete aeron embedded driver directory upon driver stop. + # Only used when transport is aeron-udp. + delete-aeron-dir = yes + + # Level of CPU time used, on a scale between 1 and 10, during backoff/idle. + # The tradeoff is that to have low latency more CPU time must be used to be + # able to react quickly on incoming messages or send as fast as possible after + # backoff backpressure. + # Level 1 strongly prefer low CPU consumption over low latency. + # Level 10 strongly prefer low latency over low CPU consumption. + # Only used when transport is aeron-udp. + idle-cpu-level = 5 + + # messages that are not accepted by Aeron are dropped after retrying for this period + # Only used when transport is aeron-udp. + give-up-message-after = 60 seconds + + # Timeout after which aeron driver has not had keepalive messages + # from a client before it considers the client dead. + # Only used when transport is aeron-udp. + client-liveness-timeout = 20 seconds + + # Timeout for each the INACTIVE and LINGER stages an aeron image + # will be retained for when it is no longer referenced. + # This timeout must be less than the 'handshake-timeout'. + # Only used when transport is aeron-udp. + image-liveness-timeout = 10 seconds + + # Timeout after which the aeron driver is considered dead + # if it does not update its C'n'C timestamp. + # Only used when transport is aeron-udp. + driver-timeout = 20 seconds + } + + # Only used when transport is tcp or tls-tcp. + tcp { + # Timeout of establishing outbound connections. + connection-timeout = 5 seconds + } + + } # SSL configuration that is used when transport=tls-tcp. diff --git a/akka-remote/src/main/scala/akka/remote/Endpoint.scala b/akka-remote/src/main/scala/akka/remote/Endpoint.scala index f99f82288f..e24b2fcfca 100644 --- a/akka-remote/src/main/scala/akka/remote/Endpoint.scala +++ b/akka-remote/src/main/scala/akka/remote/Endpoint.scala @@ -633,7 +633,7 @@ private[remote] class EndpointWriter( private val markLog = Logging.withMarker(this) val extendedSystem: ExtendedActorSystem = context.system.asInstanceOf[ExtendedActorSystem] val remoteMetrics = RemoteMetricsExtension(extendedSystem) - val backoffDispatcher = context.system.dispatchers.lookup("akka.remote.backoff-remote-dispatcher") + val backoffDispatcher = context.system.dispatchers.lookup("akka.remote.classic.backoff-remote-dispatcher") var reader: Option[ActorRef] = None var handle: Option[AkkaProtocolHandle] = handleOrActive diff --git a/akka-remote/src/main/scala/akka/remote/RemoteSettings.scala b/akka-remote/src/main/scala/akka/remote/RemoteSettings.scala index afeb926470..1bc840231d 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteSettings.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteSettings.scala @@ -5,8 +5,10 @@ package akka.remote import com.typesafe.config.Config + import scala.concurrent.duration._ import akka.util.Timeout + import scala.collection.immutable import akka.util.Helpers.{ toRootLowerCase, ConfigOps, Requiring } import akka.japi.Util._ @@ -24,22 +26,22 @@ final class RemoteSettings(val config: Config) { val WarnAboutDirectUse: Boolean = getBoolean("akka.remote.warn-about-direct-use") - val LogReceive: Boolean = getBoolean("akka.remote.log-received-messages") + val LogReceive: Boolean = getBoolean("akka.remote.classic.log-received-messages") - val LogSend: Boolean = getBoolean("akka.remote.log-sent-messages") + val LogSend: Boolean = getBoolean("akka.remote.classic.log-sent-messages") val LogFrameSizeExceeding: Option[Int] = { - if (config.getString("akka.remote.log-frame-size-exceeding").toLowerCase == "off") None - else Some(getBytes("akka.remote.log-frame-size-exceeding").toInt) + if (config.getString("akka.remote.classic.log-frame-size-exceeding").toLowerCase == "off") None + else Some(getBytes("akka.remote.classic.log-frame-size-exceeding").toInt) } - val UntrustedMode: Boolean = getBoolean("akka.remote.untrusted-mode") + val UntrustedMode: Boolean = getBoolean("akka.remote.classic.untrusted-mode") val TrustedSelectionPaths: Set[String] = - immutableSeq(getStringList("akka.remote.trusted-selection-paths")).toSet + immutableSeq(getStringList("akka.remote.classic.trusted-selection-paths")).toSet - val RemoteLifecycleEventsLogLevel - : LogLevel = toRootLowerCase(getString("akka.remote.log-remote-lifecycle-events")) match { + val RemoteLifecycleEventsLogLevel: LogLevel = toRootLowerCase( + getString("akka.remote.classic.log-remote-lifecycle-events")) match { case "on" => Logging.DebugLevel case other => Logging.levelFor(other) match { @@ -49,34 +51,34 @@ final class RemoteSettings(val config: Config) { } } - val Dispatcher: String = getString("akka.remote.use-dispatcher") + val Dispatcher: String = getString("akka.remote.classic.use-dispatcher") def configureDispatcher(props: Props): Props = if (Dispatcher.isEmpty) props else props.withDispatcher(Dispatcher) val ShutdownTimeout: Timeout = { - Timeout(config.getMillisDuration("akka.remote.shutdown-timeout")) + Timeout(config.getMillisDuration("akka.remote.classic.shutdown-timeout")) }.requiring(_.duration > Duration.Zero, "shutdown-timeout must be > 0") val FlushWait: FiniteDuration = { - config.getMillisDuration("akka.remote.flush-wait-on-shutdown") + config.getMillisDuration("akka.remote.classic.flush-wait-on-shutdown") }.requiring(_ > Duration.Zero, "flush-wait-on-shutdown must be > 0") val StartupTimeout: Timeout = { - Timeout(config.getMillisDuration("akka.remote.startup-timeout")) + Timeout(config.getMillisDuration("akka.remote.classic.startup-timeout")) }.requiring(_.duration > Duration.Zero, "startup-timeout must be > 0") val RetryGateClosedFor: FiniteDuration = { - config.getMillisDuration("akka.remote.retry-gate-closed-for") + config.getMillisDuration("akka.remote.classic.retry-gate-closed-for") }.requiring(_ >= Duration.Zero, "retry-gate-closed-for must be >= 0") - val UsePassiveConnections: Boolean = getBoolean("akka.remote.use-passive-connections") + val UsePassiveConnections: Boolean = getBoolean("akka.remote.classic.use-passive-connections") val BackoffPeriod: FiniteDuration = { - config.getMillisDuration("akka.remote.backoff-interval") + config.getMillisDuration("akka.remote.classic.backoff-interval") }.requiring(_ > Duration.Zero, "backoff-interval must be > 0") val LogBufferSizeExceeding: Int = { - val key = "akka.remote.log-buffer-size-exceeding" + val key = "akka.remote.classic.log-buffer-size-exceeding" config.getString(key).toLowerCase match { case "off" | "false" => Int.MaxValue case _ => config.getInt(key) @@ -84,27 +86,27 @@ final class RemoteSettings(val config: Config) { } val SysMsgAckTimeout: FiniteDuration = { - config.getMillisDuration("akka.remote.system-message-ack-piggyback-timeout") + config.getMillisDuration("akka.remote.classic.system-message-ack-piggyback-timeout") }.requiring(_ > Duration.Zero, "system-message-ack-piggyback-timeout must be > 0") val SysResendTimeout: FiniteDuration = { - config.getMillisDuration("akka.remote.resend-interval") + config.getMillisDuration("akka.remote.classic.resend-interval") }.requiring(_ > Duration.Zero, "resend-interval must be > 0") val SysResendLimit: Int = { - config.getInt("akka.remote.resend-limit") + config.getInt("akka.remote.classic.resend-limit") }.requiring(_ > 0, "resend-limit must be > 0") val SysMsgBufferSize: Int = { - getInt("akka.remote.system-message-buffer-size") + getInt("akka.remote.classic.system-message-buffer-size") }.requiring(_ > 0, "system-message-buffer-size must be > 0") val InitialSysMsgDeliveryTimeout: FiniteDuration = { - config.getMillisDuration("akka.remote.initial-system-message-delivery-timeout") + config.getMillisDuration("akka.remote.classic.initial-system-message-delivery-timeout") }.requiring(_ > Duration.Zero, "initial-system-message-delivery-timeout must be > 0") val QuarantineSilentSystemTimeout: FiniteDuration = { - val key = "akka.remote.quarantine-after-silence" + val key = "akka.remote.classic.quarantine-after-silence" config.getString(key).toLowerCase match { case "off" | "false" => Duration.Zero case _ => @@ -114,12 +116,12 @@ final class RemoteSettings(val config: Config) { val QuarantineDuration: FiniteDuration = { config - .getMillisDuration("akka.remote.prune-quarantine-marker-after") + .getMillisDuration("akka.remote.classic.prune-quarantine-marker-after") .requiring(_ > Duration.Zero, "prune-quarantine-marker-after must be > 0 ms") } val CommandAckTimeout: Timeout = { - Timeout(config.getMillisDuration("akka.remote.command-ack-timeout")) + Timeout(config.getMillisDuration("akka.remote.classic.command-ack-timeout")) }.requiring(_.duration > Duration.Zero, "command-ack-timeout must be > 0") val WatchFailureDetectorConfig: Config = getConfig("akka.remote.watch-failure-detector") @@ -142,9 +144,10 @@ final class RemoteSettings(val config: Config) { transportConfig) } - val Adapters: Map[String, String] = configToMap(getConfig("akka.remote.adapters")) + val Adapters: Map[String, String] = configToMap(getConfig("akka.remote.classic.adapters")) - private def transportNames: immutable.Seq[String] = immutableSeq(getStringList("akka.remote.enabled-transports")) + private def transportNames: immutable.Seq[String] = + immutableSeq(getStringList("akka.remote.classic.enabled-transports")) private def transportConfigFor(transportName: String): Config = getConfig(transportName) diff --git a/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala b/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala index 5420fccbf0..ff65b5f973 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/ArterySettings.scala @@ -70,7 +70,6 @@ private[akka] final class ArterySettings private (config: Config) { val LogReceive: Boolean = getBoolean("log-received-messages") val LogSend: Boolean = getBoolean("log-sent-messages") - val LogAeronCounters: Boolean = config.getBoolean("log-aeron-counters") val Transport: Transport = toRootLowerCase(getString("transport")) match { case AeronUpd.configName => AeronUpd @@ -94,7 +93,6 @@ private[akka] final class ArterySettings private (config: Config) { import config._ val TestMode: Boolean = getBoolean("test-mode") - val Dispatcher: String = getString("use-dispatcher") val ControlStreamDispatcher: String = getString("use-control-stream-dispatcher") val MaterializerSettings: ActorMaterializerSettings = { @@ -108,13 +106,6 @@ private[akka] final class ArterySettings private (config: Config) { else settings.withDispatcher(ControlStreamDispatcher) } - val EmbeddedMediaDriver: Boolean = getBoolean("embedded-media-driver") - val AeronDirectoryName: String = getString("aeron-dir").requiring( - dir => EmbeddedMediaDriver || dir.nonEmpty, - "aeron-dir must be defined when using external media driver") - val DeleteAeronDirectory: Boolean = getBoolean("delete-aeron-dir") - val IdleCpuLevel: Int = - getInt("idle-cpu-level").requiring(level => 1 <= level && level <= 10, "idle-cpu-level must be between 1 and 10") val OutboundLanes: Int = getInt("outbound-lanes").requiring(n => n > 0, "outbound-lanes must be greater than zero") val InboundLanes: Int = getInt("inbound-lanes").requiring(n => n > 0, "inbound-lanes must be greater than zero") val SysMsgBufferSize: Int = @@ -140,12 +131,6 @@ private[akka] final class ArterySettings private (config: Config) { config .getMillisDuration("inject-handshake-interval") .requiring(interval => interval > Duration.Zero, "inject-handshake-interval must be more than zero") - val ConnectionTimeout: FiniteDuration = config - .getMillisDuration("connection-timeout") - .requiring(interval => interval > Duration.Zero, "connection-timeout must be more than zero") - val GiveUpMessageAfter: FiniteDuration = config - .getMillisDuration("give-up-message-after") - .requiring(interval => interval > Duration.Zero, "give-up-message-after must be more than zero") val GiveUpSystemMessageAfter: FiniteDuration = config .getMillisDuration("give-up-system-message-after") @@ -184,17 +169,6 @@ private[akka] final class ArterySettings private (config: Config) { .getMillisDuration("outbound-restart-timeout") .requiring(interval => interval > Duration.Zero, "outbound-restart-timeout must be more than zero") val OutboundMaxRestarts: Int = getInt("outbound-max-restarts") - val ClientLivenessTimeout: FiniteDuration = - config - .getMillisDuration("client-liveness-timeout") - .requiring(interval => interval > Duration.Zero, "client-liveness-timeout must be more than zero") - val ImageLivenessTimeout: FiniteDuration = config - .getMillisDuration("image-liveness-timeout") - .requiring(interval => interval > Duration.Zero, "image-liveness-timeout must be more than zero") - require(ImageLivenessTimeout < HandshakeTimeout, "image-liveness-timeout must be less than handshake-timeout") - val DriverTimeout: FiniteDuration = config - .getMillisDuration("driver-timeout") - .requiring(interval => interval > Duration.Zero, "driver-timeout must be more than zero") val FlightRecorderEnabled: Boolean = getBoolean("flight-recorder.enabled") val FlightRecorderDestination: String = getString("flight-recorder.destination") val Compression = new Compression(getConfig("compression")) @@ -212,6 +186,45 @@ private[akka] final class ArterySettings private (config: Config) { .requiring(_ >= 32 * 1024, "maximum-large-frame-size must be greater than or equal to 32 KiB") final val LargeBufferPoolSize: Int = getInt("large-buffer-pool-size").requiring(_ > 0, "large-buffer-pool-size must be greater than 0") + + object Aeron { + val config: Config = getConfig("aeron") + + val LogAeronCounters: Boolean = config.getBoolean("log-aeron-counters") + val EmbeddedMediaDriver: Boolean = config.getBoolean("embedded-media-driver") + val AeronDirectoryName: String = config + .getString("aeron-dir") + .requiring( + dir => EmbeddedMediaDriver || dir.nonEmpty, + "aeron-dir must be defined when using external media driver") + val DeleteAeronDirectory: Boolean = config.getBoolean("delete-aeron-dir") + val IdleCpuLevel: Int = + config + .getInt("idle-cpu-level") + .requiring(level => 1 <= level && level <= 10, "idle-cpu-level must be between 1 and 10") + val GiveUpMessageAfter: FiniteDuration = config + .getMillisDuration("give-up-message-after") + .requiring(interval => interval > Duration.Zero, "give-up-message-after must be more than zero") + val ClientLivenessTimeout: FiniteDuration = + config + .getMillisDuration("client-liveness-timeout") + .requiring(interval => interval > Duration.Zero, "client-liveness-timeout must be more than zero") + val ImageLivenessTimeout: FiniteDuration = config + .getMillisDuration("image-liveness-timeout") + .requiring(interval => interval > Duration.Zero, "image-liveness-timeout must be more than zero") + require(ImageLivenessTimeout < HandshakeTimeout, "image-liveness-timeout must be less than handshake-timeout") + val DriverTimeout: FiniteDuration = config + .getMillisDuration("driver-timeout") + .requiring(interval => interval > Duration.Zero, "driver-timeout must be more than zero") + } + + object Tcp { + val config: Config = getConfig("tcp") + val ConnectionTimeout: FiniteDuration = config + .getMillisDuration("connection-timeout") + .requiring(interval => interval > Duration.Zero, "connection-timeout must be more than zero") + } + } } diff --git a/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala b/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala index 8fe67a2a1b..b04b1018ea 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/ArteryTransport.scala @@ -538,7 +538,7 @@ private[remote] abstract class ArteryTransport(_system: ExtendedActorSystem, _pr else log.debug("Shutting down [{}] via shutdownHook", localAddress) if (hasBeenShutdown.compareAndSet(false, true)) { - Await.result(internalShutdown(), settings.Advanced.DriverTimeout + 3.seconds) + Await.result(internalShutdown(), settings.Advanced.Aeron.DriverTimeout + 3.seconds) } } } diff --git a/akka-remote/src/main/scala/akka/remote/artery/Association.scala b/akka-remote/src/main/scala/akka/remote/artery/Association.scala index 3850f4469d..5677473cae 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/Association.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/Association.scala @@ -600,7 +600,7 @@ private[remote] class Association( val StopIdleOutboundAfter = settings.Advanced.StopIdleOutboundAfter val QuarantineIdleOutboundAfter = settings.Advanced.QuarantineIdleOutboundAfter val interval = StopIdleOutboundAfter / 2 - val initialDelay = settings.Advanced.ConnectionTimeout.max(StopIdleOutboundAfter) + 1.second + val initialDelay = settings.Advanced.Tcp.ConnectionTimeout.max(StopIdleOutboundAfter) + 1.second val task = transport.system.scheduler.schedule(initialDelay, interval) { val lastUsedDurationNanos = System.nanoTime() - associationState.lastUsedTimestamp.get if (lastUsedDurationNanos >= QuarantineIdleOutboundAfter.toNanos && !associationState.isQuarantined()) { diff --git a/akka-remote/src/main/scala/akka/remote/artery/aeron/ArteryAeronUdpTransport.scala b/akka-remote/src/main/scala/akka/remote/artery/aeron/ArteryAeronUdpTransport.scala index f7347f63a6..d14f0c4873 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/aeron/ArteryAeronUdpTransport.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/aeron/ArteryAeronUdpTransport.scala @@ -66,7 +66,7 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro @volatile private[this] var aeronErrorLogTask: Cancellable = _ @volatile private[this] var aeronErrorLog: AeronErrorLog = _ - private val taskRunner = new TaskRunner(system, settings.Advanced.IdleCpuLevel) + private val taskRunner = new TaskRunner(system, settings.Advanced.Aeron.IdleCpuLevel) private def inboundChannel = s"aeron:udp?endpoint=${bindAddress.address.host.get}:${bindAddress.address.port.get}" private def outboundChannel(a: Address) = s"aeron:udp?endpoint=${a.host.get}:${a.port.get}" @@ -76,7 +76,7 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro startAeron() startAeronErrorLog() topLevelFlightRecorder.loFreq(Transport_AeronErrorLogStarted, NoMetaData) - if (settings.LogAeronCounters) { + if (settings.Advanced.Aeron.LogAeronCounters) { startAeronCounterLog() } taskRunner.start() @@ -84,21 +84,21 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro } private def startMediaDriver(): Unit = { - if (settings.Advanced.EmbeddedMediaDriver) { + if (settings.Advanced.Aeron.EmbeddedMediaDriver) { val driverContext = new MediaDriver.Context - if (settings.Advanced.AeronDirectoryName.nonEmpty) { - driverContext.aeronDirectoryName(settings.Advanced.AeronDirectoryName) + if (settings.Advanced.Aeron.AeronDirectoryName.nonEmpty) { + driverContext.aeronDirectoryName(settings.Advanced.Aeron.AeronDirectoryName) } else { // create a random name but include the actor system name for easier debugging val uniquePart = UUID.randomUUID().toString val randomName = s"${CommonContext.AERON_DIR_PROP_DEFAULT}-${system.name}-$uniquePart" driverContext.aeronDirectoryName(randomName) } - driverContext.clientLivenessTimeoutNs(settings.Advanced.ClientLivenessTimeout.toNanos) - driverContext.imageLivenessTimeoutNs(settings.Advanced.ImageLivenessTimeout.toNanos) - driverContext.driverTimeoutMs(settings.Advanced.DriverTimeout.toMillis) + driverContext.clientLivenessTimeoutNs(settings.Advanced.Aeron.ClientLivenessTimeout.toNanos) + driverContext.imageLivenessTimeoutNs(settings.Advanced.Aeron.ImageLivenessTimeout.toNanos) + driverContext.driverTimeoutMs(settings.Advanced.Aeron.DriverTimeout.toMillis) - val idleCpuLevel = settings.Advanced.IdleCpuLevel + val idleCpuLevel = settings.Advanced.Aeron.IdleCpuLevel if (idleCpuLevel == 10) { driverContext .threadingMode(ThreadingMode.DEDICATED) @@ -131,7 +131,7 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro private def aeronDir: String = mediaDriver.get match { case Some(driver) => driver.aeronDirectoryName - case None => settings.Advanced.AeronDirectoryName + case None => settings.Advanced.Aeron.AeronDirectoryName } private def stopMediaDriver(): Unit = { @@ -147,7 +147,7 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro } try { - if (settings.Advanced.DeleteAeronDirectory) { + if (settings.Advanced.Aeron.DeleteAeronDirectory) { IoUtil.delete(new File(driver.aeronDirectoryName), false) topLevelFlightRecorder.loFreq(Transport_MediaFileDeleted, NoMetaData) } @@ -165,7 +165,7 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro private def startAeron(): Unit = { val ctx = new Aeron.Context - ctx.driverTimeoutMs(settings.Advanced.DriverTimeout.toMillis) + ctx.driverTimeoutMs(settings.Advanced.Aeron.DriverTimeout.toMillis) ctx.availableImageHandler(new AvailableImageHandler { override def onAvailableImage(img: Image): Unit = { @@ -208,11 +208,11 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro "{} Aeron media driver. Possible configuration properties to mitigate the problem are " + "'client-liveness-timeout' or 'driver-timeout'. {}", Logging.simpleName(cause), - if (settings.Advanced.EmbeddedMediaDriver) "embedded" else "external", + if (settings.Advanced.Aeron.EmbeddedMediaDriver) "embedded" else "external", cause) taskRunner.stop() aeronErrorLogTask.cancel() - if (settings.LogAeronCounters) aeronCounterTask.cancel() + if (settings.Advanced.Aeron.LogAeronCounters) aeronCounterTask.cancel() system.terminate() throw new AeronTerminated(cause) } @@ -284,7 +284,7 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro bufferPool: EnvelopeBufferPool): Sink[EnvelopeBuffer, Future[Done]] = { val giveUpAfter = if (streamId == ControlStreamId) settings.Advanced.GiveUpSystemMessageAfter - else settings.Advanced.GiveUpMessageAfter + else settings.Advanced.Aeron.GiveUpMessageAfter // TODO: Note that the AssociationState.controlStreamIdleKillSwitch in control stream is not used for the // Aeron transport. Would be difficult to handle the Future[Done] materialized value. // If we want to stop for Aeron also it is probably easier to stop the publication inside the @@ -313,8 +313,8 @@ private[remote] class ArteryAeronUdpTransport(_system: ExtendedActorSystem, _pro private def aeronSourceSpinningStrategy: Int = if (settings.Advanced.InboundLanes > 1 || // spinning was identified to be the cause of massive slowdowns with multiple lanes, see #21365 - settings.Advanced.IdleCpuLevel < 5) 0 // also don't spin for small IdleCpuLevels - else 50 * settings.Advanced.IdleCpuLevel - 240 + settings.Advanced.Aeron.IdleCpuLevel < 5) 0 // also don't spin for small IdleCpuLevels + else 50 * settings.Advanced.Aeron.IdleCpuLevel - 240 override protected def runInboundStreams(): Unit = { runInboundControlStream() diff --git a/akka-remote/src/main/scala/akka/remote/artery/tcp/ArteryTcpTransport.scala b/akka-remote/src/main/scala/akka/remote/artery/tcp/ArteryTcpTransport.scala index 24ed0442d6..74244d1b83 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/tcp/ArteryTcpTransport.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/tcp/ArteryTcpTransport.scala @@ -124,13 +124,13 @@ private[remote] class ArteryTcpTransport( Tcp().outgoingTlsConnectionWithSSLEngine( remoteAddress, createSSLEngine = () => sslProvider.createClientSSLEngine(host, port), - connectTimeout = settings.Advanced.ConnectionTimeout, + connectTimeout = settings.Advanced.Tcp.ConnectionTimeout, verifySession = session => optionToTry(sslProvider.verifyClientSession(host, session))) } else { Tcp().outgoingConnection( remoteAddress, halfClose = true, // issue https://github.com/akka/akka/issues/24392 if set to false - connectTimeout = settings.Advanced.ConnectionTimeout) + connectTimeout = settings.Advanced.Tcp.ConnectionTimeout) } def connectionFlowWithRestart: Flow[ByteString, ByteString, NotUsed] = { diff --git a/akka-remote/src/main/scala/akka/remote/transport/AkkaProtocolTransport.scala b/akka-remote/src/main/scala/akka/remote/transport/AkkaProtocolTransport.scala index 4ec49db95e..75efd89d68 100644 --- a/akka-remote/src/main/scala/akka/remote/transport/AkkaProtocolTransport.scala +++ b/akka-remote/src/main/scala/akka/remote/transport/AkkaProtocolTransport.scala @@ -39,26 +39,26 @@ private[remote] class AkkaProtocolSettings(config: Config) { import akka.util.Helpers.ConfigOps import config._ - val TransportFailureDetectorConfig: Config = getConfig("akka.remote.transport-failure-detector") + val TransportFailureDetectorConfig: Config = getConfig("akka.remote.classic.transport-failure-detector") val TransportFailureDetectorImplementationClass: String = TransportFailureDetectorConfig.getString("implementation-class") val TransportHeartBeatInterval: FiniteDuration = { TransportFailureDetectorConfig.getMillisDuration("heartbeat-interval") }.requiring(_ > Duration.Zero, "transport-failure-detector.heartbeat-interval must be > 0") - val RequireCookie: Boolean = getBoolean("akka.remote.require-cookie") + val RequireCookie: Boolean = getBoolean("akka.remote.classic.require-cookie") - val SecureCookie: Option[String] = if (RequireCookie) Some(getString("akka.remote.secure-cookie")) else None + val SecureCookie: Option[String] = if (RequireCookie) Some(getString("akka.remote.classic.secure-cookie")) else None val HandshakeTimeout: FiniteDuration = { - val enabledTransports = config.getStringList("akka.remote.enabled-transports") - if (enabledTransports.contains("akka.remote.netty.tcp")) - config.getMillisDuration("akka.remote.netty.tcp.connection-timeout") - else if (enabledTransports.contains("akka.remote.netty.ssl")) - config.getMillisDuration("akka.remote.netty.ssl.connection-timeout") + val enabledTransports = config.getStringList("akka.remote.classic.enabled-transports") + if (enabledTransports.contains("akka.remote.classic.netty.tcp")) + config.getMillisDuration("akka.remote.classic.netty.tcp.connection-timeout") + else if (enabledTransports.contains("akka.remote.classic.netty.ssl")) + config.getMillisDuration("akka.remote.classic.netty.ssl.connection-timeout") else config - .getMillisDuration("akka.remote.handshake-timeout") + .getMillisDuration("akka.remote.classic.handshake-timeout") .requiring(_ > Duration.Zero, "handshake-timeout must be > 0") } } @@ -222,7 +222,7 @@ private[remote] class AkkaProtocolHandle( def disassociate(info: DisassociateInfo): Unit = stateActor ! DisassociateUnderlying(info) } -private[transport] object ProtocolStateActor { +private[remote] object ProtocolStateActor { sealed trait AssociationState /* @@ -324,7 +324,7 @@ private[transport] object ProtocolStateActor { failureDetector).withDeploy(Deploy.local) } -private[transport] class ProtocolStateActor( +private[remote] class ProtocolStateActor( initialData: InitialProtocolStateData, private val localHandshakeInfo: HandshakeInfo, private val refuseUid: Option[Int], diff --git a/akka-remote/src/main/scala/akka/remote/transport/FailureInjectorTransportAdapter.scala b/akka-remote/src/main/scala/akka/remote/transport/FailureInjectorTransportAdapter.scala index e6a53a889b..4b217757ea 100644 --- a/akka-remote/src/main/scala/akka/remote/transport/FailureInjectorTransportAdapter.scala +++ b/akka-remote/src/main/scala/akka/remote/transport/FailureInjectorTransportAdapter.scala @@ -66,7 +66,7 @@ private[remote] class FailureInjectorTransportAdapter( private def rng = ThreadLocalRandom.current() private val log = Logging(extendedSystem, getClass.getName) - private val shouldDebugLog: Boolean = extendedSystem.settings.config.getBoolean("akka.remote.gremlin.debug") + private val shouldDebugLog: Boolean = extendedSystem.settings.config.getBoolean("akka.remote.classic.gremlin.debug") @volatile private var upstreamListener: Option[AssociationEventListener] = None private[transport] val addressChaosTable = new ConcurrentHashMap[Address, GremlinMode]() diff --git a/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala b/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala index 0ed37868c4..f7d7c72414 100644 --- a/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala +++ b/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala @@ -28,9 +28,6 @@ import akka.event.Logging import akka.remote.RARP import akka.remote.transport.AssociationHandle.HandleEventListener import akka.remote.transport.Transport._ -import akka.remote.transport.netty.NettyTransportSettings.Mode -import akka.remote.transport.netty.NettyTransportSettings.Tcp -import akka.remote.transport.netty.NettyTransportSettings.Udp import akka.remote.transport.AssociationHandle import akka.remote.transport.Transport import akka.util.Helpers @@ -52,7 +49,6 @@ import org.jboss.netty.channel.group.ChannelGroupFuture import org.jboss.netty.channel.group.ChannelGroupFutureListener import org.jboss.netty.channel.group.DefaultChannelGroup import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory -import org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory import org.jboss.netty.channel.socket.nio.NioWorkerPool import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder @@ -60,12 +56,6 @@ import org.jboss.netty.handler.codec.frame.LengthFieldPrepender import org.jboss.netty.handler.ssl.SslHandler import org.jboss.netty.util.HashedWheelTimer -object NettyTransportSettings { - sealed trait Mode - case object Tcp extends Mode { override def toString = "tcp" } - case object Udp extends Mode { override def toString = "udp" } -} - object NettyFutureBridge { def apply(nettyFuture: ChannelFuture): Future[Channel] = { val p = Promise[Channel]() @@ -120,14 +110,7 @@ class NettyTransportSettings(config: Config) { import akka.util.Helpers.ConfigOps import config._ - val TransportMode: Mode = getString("transport-protocol") match { - case "tcp" => Tcp - case "udp" => Udp - case unknown => throw new ConfigurationException(s"Unknown transport: [$unknown]") - } - - val EnableSsl: Boolean = - getBoolean("enable-ssl").requiring(!_ || TransportMode == Tcp, s"$TransportMode does not support SSL") + val EnableSsl: Boolean = getBoolean("enable-ssl") val SSLEngineProviderClassName: String = if (EnableSsl) getString("ssl-engine-provider") else "" @@ -151,7 +134,6 @@ class NettyTransportSettings(config: Config) { val SendBufferSize: Option[Int] = optionSize("send-buffer-size") val ReceiveBufferSize: Option[Int] = optionSize("receive-buffer-size") - .requiring(s => s.isDefined || TransportMode != Udp, "receive-buffer-size must be specified for UDP") val MaxFrameSize: Int = getBytes("maximum-frame-size").toInt .requiring(_ >= 32000, s"Setting 'maximum-frame-size' must be at least 32000 bytes") @@ -242,7 +224,7 @@ private[netty] trait CommonHandlers extends NettyHelpers { channel: Channel, remoteSocketAddress: SocketAddress, remoteAddress: Address, - msg: ChannelBuffer)(op: (AssociationHandle => Any)): Unit = { + msg: ChannelBuffer)(op: AssociationHandle => Any): Unit = { import transport._ NettyTransport.addressFromSocketAddress( channel.getLocalAddress, @@ -345,7 +327,6 @@ private[transport] object NettyTransport { addressFromSocketAddress(addr, schemeIdentifier, systemName, hostName, port = None) } -// FIXME: Split into separate UDP and TCP classes class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedActorSystem) extends Transport { def this(system: ExtendedActorSystem, conf: Config) = this(new NettyTransportSettings(conf), system) @@ -362,12 +343,9 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA .map(system.dispatchers.lookup) .getOrElse(system.dispatcher) - override val schemeIdentifier: String = (if (EnableSsl) "ssl." else "") + TransportMode + override val schemeIdentifier: String = (if (EnableSsl) "ssl." else "") + "tcp" override def maximumPayloadBytes: Int = settings.MaxFrameSize - private final val isDatagram = TransportMode == Udp - - @volatile private var localAddress: Address = _ @volatile private var boundTo: Address = _ @volatile private var serverChannel: Channel = _ @@ -391,46 +369,33 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA "akka-netty-transport-driver-channelgroup-" + uniqueIdCounter.getAndIncrement) - private val clientChannelFactory: ChannelFactory = TransportMode match { - case Tcp => - val boss, worker = createExecutorService() - // We need to create a HashedWheelTimer here since Netty creates one with a thread that - // doesn't respect the akka.daemonic setting - new NioClientSocketChannelFactory( - boss, - 1, - new NioWorkerPool(worker, ClientSocketWorkerPoolSize), - new HashedWheelTimer(system.threadFactory)) - case Udp => - // This does not create a HashedWheelTimer internally - new NioDatagramChannelFactory(createExecutorService(), ClientSocketWorkerPoolSize) + private val clientChannelFactory: ChannelFactory = { + val boss, worker = createExecutorService() + new NioClientSocketChannelFactory( + boss, + 1, + new NioWorkerPool(worker, ClientSocketWorkerPoolSize), + new HashedWheelTimer(system.threadFactory)) } - private val serverChannelFactory: ChannelFactory = TransportMode match { - case Tcp => - val boss, worker = createExecutorService() - // This does not create a HashedWheelTimer internally - new NioServerSocketChannelFactory(boss, worker, ServerSocketWorkerPoolSize) - case Udp => - // This does not create a HashedWheelTimer internally - new NioDatagramChannelFactory(createExecutorService(), ServerSocketWorkerPoolSize) + private val serverChannelFactory: ChannelFactory = { + val boss, worker = createExecutorService() + // This does not create a HashedWheelTimer internally + new NioServerSocketChannelFactory(boss, worker, ServerSocketWorkerPoolSize) } private def newPipeline: DefaultChannelPipeline = { val pipeline = new DefaultChannelPipeline - - if (!isDatagram) { - pipeline.addLast( - "FrameDecoder", - new LengthFieldBasedFrameDecoder( - maximumPayloadBytes, - 0, - FrameLengthFieldLength, - 0, - FrameLengthFieldLength, // Strip the header - true)) - pipeline.addLast("FrameEncoder", new LengthFieldPrepender(FrameLengthFieldLength)) - } + pipeline.addLast( + "FrameDecoder", + new LengthFieldBasedFrameDecoder( + maximumPayloadBytes, + 0, + FrameLengthFieldLength, + 0, + FrameLengthFieldLength, // Strip the header + true)) + pipeline.addLast("FrameEncoder", new LengthFieldPrepender(FrameLengthFieldLength)) pipeline } @@ -466,10 +431,7 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA override def getPipeline: ChannelPipeline = { val pipeline = newPipeline if (EnableSsl) pipeline.addFirst("SslHandler", sslHandler(isClient = false)) - @silent - val handler = - if (isDatagram) new UdpServerHandler(NettyTransport.this, associationListenerPromise.future) - else new TcpServerHandler(NettyTransport.this, associationListenerPromise.future, log) + val handler = new TcpServerHandler(NettyTransport.this, associationListenerPromise.future, log) pipeline.addLast("ServerHandler", handler) pipeline } @@ -480,10 +442,7 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA override def getPipeline: ChannelPipeline = { val pipeline = newPipeline if (EnableSsl) pipeline.addFirst("SslHandler", sslHandler(isClient = true)) - @silent - val handler = - if (isDatagram) new UdpClientHandler(NettyTransport.this, remoteAddress) - else new TcpClientHandler(NettyTransport.this, remoteAddress, log) + val handler = new TcpClientHandler(NettyTransport.this, remoteAddress, log) pipeline.addLast("clienthandler", handler) pipeline } @@ -495,10 +454,6 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA bootstrap.setOption("child.tcpNoDelay", settings.TcpNodelay) bootstrap.setOption("child.keepAlive", settings.TcpKeepalive) bootstrap.setOption("reuseAddress", settings.TcpReuseAddr) - if (isDatagram) - bootstrap.setOption( - "receiveBufferSizePredictorFactory", - new FixedReceiveBufferSizePredictorFactory(ReceiveBufferSize.get)) settings.ReceiveBufferSize.foreach(sz => bootstrap.setOption("receiveBufferSize", sz)) settings.SendBufferSize.foreach(sz => bootstrap.setOption("sendBufferSize", sz)) settings.WriteBufferHighWaterMark.foreach(sz => bootstrap.setOption("writeBufferHighWaterMark", sz)) @@ -506,9 +461,8 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA bootstrap } - private val inboundBootstrap: Bootstrap = settings.TransportMode match { - case Tcp => setupBootstrap(new ServerBootstrap(serverChannelFactory), serverPipelineFactory) - case Udp => setupBootstrap(new ConnectionlessBootstrap(serverChannelFactory), serverPipelineFactory) + private val inboundBootstrap: Bootstrap = { + setupBootstrap(new ServerBootstrap(serverChannelFactory), serverPipelineFactory) } private def outboundBootstrap(remoteAddress: Address): ClientBootstrap = { @@ -567,7 +521,6 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA throw new NettyTransportException( s"Unknown local address type [${newServerChannel.getLocalAddress.getClass.getName}]") } - localAddress = address associationListenerPromise.future.foreach { _ => newServerChannel.setReadable(true) } @@ -603,23 +556,10 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA blocking { channel.getPipeline.get(classOf[SslHandler]).handshake().awaitUninterruptibly() } - if (!isDatagram) channel.setReadable(false) + channel.setReadable(false) channel } - handle <- if (isDatagram) - Future { - readyChannel.getRemoteAddress match { - case address: InetSocketAddress => - val handle = new UdpAssociationHandle(localAddress, remoteAddress, readyChannel, NettyTransport.this) - handle.readHandlerPromise.future.foreach { listener => - udpConnectionTable.put(address, listener) - } - handle - case unknown => - throw new NettyTransportException(s"Unknown outbound remote address type [${unknown.getClass.getName}]") - } - } else - readyChannel.getPipeline.get(classOf[ClientHandler]).statusFuture + handle <- readyChannel.getPipeline.get(classOf[ClientHandler]).statusFuture } yield handle).recover { case _: CancellationException => throw new NettyTransportExceptionNoStack("Connection was cancelled") case NonFatal(t) => diff --git a/akka-remote/src/main/scala/akka/remote/transport/netty/SSLEngineProvider.scala b/akka-remote/src/main/scala/akka/remote/transport/netty/SSLEngineProvider.scala index 1bf95b0bd0..380a1e9320 100644 --- a/akka-remote/src/main/scala/akka/remote/transport/netty/SSLEngineProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/transport/netty/SSLEngineProvider.scala @@ -37,7 +37,7 @@ import javax.net.ssl.TrustManagerFactory } /** - * Config in akka.remote.netty.ssl.security + * Config in akka.remote.classic.netty.ssl.security * * Subclass may override protected methods to replace certain parts, such as key and trust manager. */ @@ -47,7 +47,7 @@ import javax.net.ssl.TrustManagerFactory def this(system: ActorSystem) = this( Logging.withMarker(system, classOf[ConfigSSLEngineProvider].getName), - new SSLSettings(system.settings.config.getConfig("akka.remote.netty.ssl.security"))) + new SSLSettings(system.settings.config.getConfig("akka.remote.classic.netty.ssl.security"))) import settings._ diff --git a/akka-remote/src/main/scala/akka/remote/transport/netty/UdpSupport.scala b/akka-remote/src/main/scala/akka/remote/transport/netty/UdpSupport.scala deleted file mode 100644 index a98ef0bf49..0000000000 --- a/akka-remote/src/main/scala/akka/remote/transport/netty/UdpSupport.scala +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2009-2019 Lightbend Inc. - */ - -package akka.remote.transport.netty - -import akka.actor.Address -import akka.remote.transport.AssociationHandle -import akka.remote.transport.AssociationHandle.{ HandleEventListener, InboundPayload } -import akka.remote.transport.Transport.AssociationEventListener -import akka.util.ByteString -import java.net.{ InetAddress, InetSocketAddress, SocketAddress } -import org.jboss.netty.buffer.{ ChannelBuffer, ChannelBuffers } -import org.jboss.netty.channel._ -import scala.concurrent.{ Future, Promise } - -/** - * INTERNAL API - */ -@deprecated("Deprecated in favour of Artery (the new Aeron/UDP based remoting implementation).", since = "2.5.0") -private[remote] trait UdpHandlers extends CommonHandlers { - - override def createHandle(channel: Channel, localAddress: Address, remoteAddress: Address): AssociationHandle = - new UdpAssociationHandle(localAddress, remoteAddress, channel, transport) - - override def registerListener( - channel: Channel, - listener: HandleEventListener, - msg: ChannelBuffer, - remoteSocketAddress: InetSocketAddress): Unit = { - transport.udpConnectionTable.putIfAbsent(remoteSocketAddress, listener) match { - case null => listener.notify(InboundPayload(ByteString(msg.array()))) - case oldReader => - throw new NettyTransportException( - s"Listener $listener attempted to register for remote address $remoteSocketAddress but $oldReader was already registered.") - } - } - - override def onMessage(ctx: ChannelHandlerContext, e: MessageEvent): Unit = e.getRemoteAddress match { - case inetSocketAddress: InetSocketAddress => - if (!transport.udpConnectionTable.containsKey(inetSocketAddress)) { - e.getChannel.setReadable(false) - initUdp(e.getChannel, e.getRemoteAddress, e.getMessage.asInstanceOf[ChannelBuffer]) - } else { - val listener = transport.udpConnectionTable.get(inetSocketAddress) - val bytes: Array[Byte] = e.getMessage.asInstanceOf[ChannelBuffer].array() - if (bytes.length > 0) listener.notify(InboundPayload(ByteString(bytes))) - } - case _ => - } - - def initUdp(channel: Channel, remoteSocketAddress: SocketAddress, msg: ChannelBuffer): Unit -} - -/** - * INTERNAL API - */ -@deprecated("Deprecated in favour of Artery (the new Aeron/UDP based remoting implementation).", since = "2.5.0") -private[remote] class UdpServerHandler( - _transport: NettyTransport, - _associationListenerFuture: Future[AssociationEventListener]) - extends ServerHandler(_transport, _associationListenerFuture) - with UdpHandlers { - - transport.system.log.warning( - "The netty.udp transport is deprecated, please use Artery instead. See: http://doc.akka.io/docs/akka/2.4/scala/remoting-artery.html") - - override def initUdp(channel: Channel, remoteSocketAddress: SocketAddress, msg: ChannelBuffer): Unit = - initInbound(channel, remoteSocketAddress, msg) -} - -/** - * INTERNAL API - */ -@deprecated("Deprecated in favour of Artery (the new Aeron/UDP based remoting implementation).", since = "2.5.0") -private[remote] class UdpClientHandler(_transport: NettyTransport, remoteAddress: Address) - extends ClientHandler(_transport, remoteAddress) - with UdpHandlers { - - transport.system.log.warning( - "The netty.udp transport is deprecated, please use Artery instead. See: http://doc.akka.io/docs/akka/2.4/scala/remoting-artery.html") - - override def initUdp(channel: Channel, remoteSocketAddress: SocketAddress, msg: ChannelBuffer): Unit = - initOutbound(channel, remoteSocketAddress, msg) -} - -/** - * INTERNAL API - */ -private[remote] class UdpAssociationHandle( - val localAddress: Address, - val remoteAddress: Address, - private val channel: Channel, - private val transport: NettyTransport) - extends AssociationHandle { - - override val readHandlerPromise: Promise[HandleEventListener] = Promise() - - override def write(payload: ByteString): Boolean = { - if (!channel.isConnected) - channel.connect(new InetSocketAddress(InetAddress.getByName(remoteAddress.host.get), remoteAddress.port.get)) - - if (channel.isWritable && channel.isOpen) { - channel.write(ChannelBuffers.wrappedBuffer(payload.asByteBuffer)) - true - } else false - } - - override def disassociate(): Unit = - try channel.close() - finally transport.udpConnectionTable.remove(transport.addressToSocketAddress(remoteAddress)) - -} diff --git a/akka-remote/src/test/resources/aeron.properties b/akka-remote/src/test/resources/aeron.properties index 47ab953878..b38ed1d356 100644 --- a/akka-remote/src/test/resources/aeron.properties +++ b/akka-remote/src/test/resources/aeron.properties @@ -16,7 +16,7 @@ aeron.threading.mode=SHARED_NETWORK #aeron.sender.idle.strategy=org.agrona.concurrent.BusySpinIdleStrategy #aeron.receiver.idle.strategy=org.agrona.concurrent.BusySpinIdleStrategy -# use same directory in akka.remote.artery.advanced.aeron-dir config +# use same directory in akka.remote.artery.advanced.aeron.aeron-dir config # of the Akka application aeron.dir=target/aeron # on linux, use directory on ram disk, instead diff --git a/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala b/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala index 7df5a39bf6..c95496ac07 100644 --- a/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala @@ -24,11 +24,12 @@ class DaemonicSpec extends AkkaSpec { // create a separate actor system that we can check the threads for val daemonicSystem = ActorSystem( "daemonic", - ConfigFactory.parseString(""" + ConfigFactory.parseString( + """ akka.daemonic = on akka.actor.provider = remote - akka.remote.netty.tcp.transport-class = "akka.remote.transport.netty.NettyTransport" - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.transport-class = "akka.remote.transport.netty.NettyTransport" + akka.remote.classic.netty.tcp.port = 0 akka.log-dead-letters-during-shutdown = off """)) diff --git a/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala b/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala index 0a1104a1bf..640259763d 100644 --- a/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala @@ -26,7 +26,7 @@ object LogSourceSpec { class LogSourceSpec extends AkkaSpec(""" akka.loglevel = INFO akka.actor.provider = remote - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 """) { import LogSourceSpec._ diff --git a/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala b/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala index 8f45c73496..a4e7b0d690 100644 --- a/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala @@ -14,22 +14,25 @@ object MessageLoggingSpec { akka.loglevel = info // debug makes this test fail intentionally akka.actor.provider = remote akka.remote { + + classic { log-received-messages = on log-sent-messages = on - netty.tcp { hostname = localhost port = 0 } - artery { - enabled = $artery - transport = aeron-udp - canonical.hostname = localhost - canonical.port = 0 - log-received-messages = on - log-sent-messages = on - } + } + + artery { + enabled = $artery + transport = aeron-udp + canonical.hostname = localhost + canonical.port = 0 + log-received-messages = on + log-sent-messages = on + } } """.stripMargin) diff --git a/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala index fc06584e79..9cc32e5cf0 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala @@ -14,7 +14,7 @@ import akka.remote.transport.netty.{ NettyTransportSettings, SSLSettings } class RemoteConfigSpec extends AkkaSpec(""" akka.actor.provider = remote - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 """) { "Remoting" should { @@ -59,7 +59,7 @@ class RemoteConfigSpec extends AkkaSpec(""" WatchFailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should ===(10 seconds) WatchFailureDetectorConfig.getMillisDuration("min-std-deviation") should ===(100 millis) - remoteSettings.config.getString("akka.remote.log-frame-size-exceeding") should ===("off") + remoteSettings.config.getString("akka.remote.classic.log-frame-size-exceeding") should ===("off") } "be able to parse AkkaProtocol related config elements" in { @@ -76,7 +76,7 @@ class RemoteConfigSpec extends AkkaSpec(""" } "contain correct netty.tcp values in reference.conf" in { - val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.netty.tcp") + val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.classic.netty.tcp") val s = new NettyTransportSettings(c) import s._ @@ -100,7 +100,7 @@ class RemoteConfigSpec extends AkkaSpec(""" } "contain correct socket worker pool configuration values in reference.conf" in { - val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.netty.tcp") + val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.classic.netty.tcp") // server-socket-worker-pool { @@ -122,7 +122,7 @@ class RemoteConfigSpec extends AkkaSpec(""" } "contain correct ssl configuration values in reference.conf" in { - val sslSettings = new SSLSettings(system.settings.config.getConfig("akka.remote.netty.ssl.security")) + val sslSettings = new SSLSettings(system.settings.config.getConfig("akka.remote.classic.netty.ssl.security")) sslSettings.SSLKeyStore should ===("keystore") sslSettings.SSLKeyStorePassword should ===("changeme") sslSettings.SSLKeyPassword should ===("changeme") @@ -134,7 +134,7 @@ class RemoteConfigSpec extends AkkaSpec(""" } "have debug logging of the failure injector turned off in reference.conf" in { - val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.gremlin") + val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.classic.gremlin") c.getBoolean("debug") should ===(false) } } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala index e0afdd4dd0..3aebffa553 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala @@ -10,18 +10,20 @@ import akka.routing.ActorSelectionRoutee import akka.routing.ConsistentRoutee import akka.routing.ConsistentHash -class RemoteConsistentHashingRouterSpec extends AkkaSpec(""" +class RemoteConsistentHashingRouterSpec + extends AkkaSpec(""" + akka.remote.artery.canonical.port = 0 akka.actor.provider = remote """) { "ConsistentHashingGroup" must { "use same hash ring independent of self address" in { // simulating running router on two different nodes (a1, a2) with target routees on 3 other nodes (s1, s2, s3) - val a1 = Address("akka.tcp", "Sys", "client1", 2552) - val a2 = Address("akka.tcp", "Sys", "client2", 2552) - val s1 = ActorSelectionRoutee(system.actorSelection("akka.tcp://Sys@server1:2552/user/a/b")) - val s2 = ActorSelectionRoutee(system.actorSelection("akka.tcp://Sys@server2:2552/user/a/b")) - val s3 = ActorSelectionRoutee(system.actorSelection("akka.tcp://Sys@server3:2552/user/a/b")) + val a1 = Address("akka", "Sys", "client1", 2552) + val a2 = Address("akka", "Sys", "client2", 2552) + val s1 = ActorSelectionRoutee(system.actorSelection("akka://Sys@server1:2552/user/a/b")) + val s2 = ActorSelectionRoutee(system.actorSelection("akka://Sys@server2:2552/user/a/b")) + val s3 = ActorSelectionRoutee(system.actorSelection("akka://Sys@server3:2552/user/a/b")) val nodes1 = List(ConsistentRoutee(s1, a1), ConsistentRoutee(s2, a1), ConsistentRoutee(s3, a1)) val nodes2 = List(ConsistentRoutee(s1, a2), ConsistentRoutee(s2, a2), ConsistentRoutee(s3, a2)) val consistentHash1 = ConsistentHash(nodes1, 10) diff --git a/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala index f7bb6c2eda..992cd21dd5 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala @@ -22,7 +22,7 @@ object RemoteDeployerSpec { dispatcher = mydispatcher } } - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 """, ConfigParseOptions.defaults) diff --git a/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala index bba3d6b005..f16483f923 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala @@ -25,10 +25,14 @@ class RemoteRouterSpec extends AkkaSpec(s""" akka.actor.provider = remote akka.actor.allow-java-serialization = off akka.actor.serialize-messages = off - akka.remote.netty.tcp { + akka.remote.classic.netty.tcp { hostname = localhost port = 0 } + akka.remote.artery.canonical { + hostname = "localhost" + port = 0 + } akka.actor.deployment { /remote-override { router = round-robin-pool diff --git a/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala b/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala index e8b8f27ac1..bead8fa034 100644 --- a/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala @@ -35,10 +35,12 @@ object Configuration { filter-leeway = 10s default-timeout = 10s } + + remote.artery.enabled = off - remote.enabled-transports = ["akka.remote.netty.ssl"] + remote.classic.enabled-transports = ["akka.remote.classic.netty.ssl"] - remote.netty.ssl { + remote.classic.netty.ssl { hostname = localhost port = %d security { @@ -77,7 +79,7 @@ object Configuration { val fullConfig = config .withFallback(AkkaSpec.testConf) .withFallback(ConfigFactory.load) - .getConfig("akka.remote.netty.ssl.security") + .getConfig("akka.remote.classic.netty.ssl.security") val settings = new SSLSettings(fullConfig) val sslEngineProvider = new ConfigSSLEngineProvider(NoMarkerLogging, settings) @@ -125,7 +127,7 @@ abstract class Ticket1978CommunicationSpec(val cipherConfig: CipherConfig) lazy val other: ActorSystem = ActorSystem( "remote-sys", ConfigFactory - .parseString("akka.remote.netty.ssl.port = " + cipherConfig.remotePort) + .parseString("akka.remote.classic.netty.ssl.port = " + cipherConfig.remotePort) .withFallback(system.settings.config)) override def afterTermination(): Unit = { diff --git a/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala b/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala index 7f2c6967ef..69b875e270 100644 --- a/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala @@ -8,14 +8,14 @@ import akka.testkit._ import akka.remote.transport.netty.SSLSettings class Ticket1978ConfigSpec extends AkkaSpec(""" - akka.remote.netty.ssl.security { + akka.remote.classic.netty.ssl.security { random-number-generator = "SecureRandom" } """) with ImplicitSender with DefaultTimeout { "SSL Remoting" must { "be able to parse these extra Netty config elements" in { - val settings = new SSLSettings(system.settings.config.getConfig("akka.remote.netty.ssl.security")) + val settings = new SSLSettings(system.settings.config.getConfig("akka.remote.classic.netty.ssl.security")) settings.SSLKeyStore should ===("keystore") settings.SSLKeyStorePassword should ===("changeme") diff --git a/akka-remote/src/test/scala/akka/remote/TransientSerializationErrorSpec.scala b/akka-remote/src/test/scala/akka/remote/TransientSerializationErrorSpec.scala index ef8e80cd66..83efa5e2f9 100644 --- a/akka-remote/src/test/scala/akka/remote/TransientSerializationErrorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/TransientSerializationErrorSpec.scala @@ -113,7 +113,8 @@ abstract class AbstractTransientSerializationErrorSpec(config: Config) class TransientSerializationErrorSpec extends AbstractTransientSerializationErrorSpec(ConfigFactory.parseString(""" - akka.remote.netty.tcp { + akka.remote.artery.enabled = false + akka.remote.classic.netty.tcp { hostname = localhost port = 0 } diff --git a/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala b/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala index cbc5b67e33..b45430def4 100644 --- a/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala @@ -15,7 +15,8 @@ import scala.concurrent.duration._ object TypedActorRemoteDeploySpec { val conf = ConfigFactory.parseString(""" akka.actor.provider = remote - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 + akka.remote.artery.canonical.port = 0 """) trait RemoteNameService { diff --git a/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala index 8cef3bc2bb..8f759e64bb 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala @@ -6,7 +6,7 @@ package akka.remote.artery import com.typesafe.config.ConfigFactory import akka.actor.{ ActorSystem, Address } -import akka.remote.transport.netty.NettyTransportSpec._ +import akka.remote.classic.transport.netty.NettyTransportSpec._ import scala.concurrent.Await import org.scalatest.WordSpec diff --git a/akka-remote/src/test/scala/akka/remote/artery/HandshakeDenySpec.scala b/akka-remote/src/test/scala/akka/remote/artery/HandshakeDenySpec.scala index 0374b550b2..27d06f59d1 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/HandshakeDenySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/HandshakeDenySpec.scala @@ -16,7 +16,7 @@ object HandshakeDenySpec { val commonConfig = ConfigFactory.parseString(s""" akka.loglevel = WARNING akka.remote.artery.advanced.handshake-timeout = 2s - akka.remote.artery.advanced.image-liveness-timeout = 1.9s + akka.remote.artery.advanced.aeron.image-liveness-timeout = 1.9s """).withFallback(ArterySpecSupport.defaultConfig) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala index 3a9c24b52c..55d27d9623 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/HandshakeFailureSpec.scala @@ -16,7 +16,7 @@ object HandshakeFailureSpec { val commonConfig = ConfigFactory.parseString(s""" akka.remote.artery.advanced.handshake-timeout = 2s - akka.remote.artery.advanced.image-liveness-timeout = 1.9s + akka.remote.artery.advanced.aeron.image-liveness-timeout = 1.9s """).withFallback(ArterySpecSupport.defaultConfig) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala b/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala index b965dec478..39d37821b3 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/HandshakeRetrySpec.scala @@ -14,7 +14,7 @@ import com.typesafe.config.ConfigFactory object HandshakeRetrySpec { val commonConfig = ConfigFactory.parseString(s""" akka.remote.artery.advanced.handshake-timeout = 10s - akka.remote.artery.advanced.image-liveness-timeout = 7s + akka.remote.artery.advanced.aeron.image-liveness-timeout = 7s """).withFallback(ArterySpecSupport.defaultConfig) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala index 6d67ebaac5..28f240b14e 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/LateConnectSpec.scala @@ -17,7 +17,7 @@ object LateConnectSpec { val config = ConfigFactory.parseString(s""" akka.remote.artery.advanced.handshake-timeout = 3s - akka.remote.artery.advanced.image-liveness-timeout = 2.9s + akka.remote.artery.advanced.aeron.image-liveness-timeout = 2.9s """).withFallback(ArterySpecSupport.defaultConfig) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteActorForSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteActorForSpec.scala index 656d4f16e6..cfbdf23786 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteActorForSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteActorForSpec.scala @@ -7,7 +7,7 @@ package akka.remote.artery import akka.actor.{ Actor, ActorRef, ActorRefScope, PoisonPill, Props } import akka.pattern.ask import akka.remote.RemoteActorRef -import akka.remote.RemotingSpec.ActorForReq +import akka.remote.classic.RemotingSpec.ActorForReq import akka.testkit.{ EventFilter, _ } import akka.util.Timeout import com.github.ghik.silencer.silent diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala index 8980306808..bdddb44680 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeathWatchSpec.scala @@ -33,7 +33,7 @@ object RemoteDeathWatchSpec { # must still be longer than failure detection remote.artery.advanced { handshake-timeout = 10 s - image-liveness-timeout = 9 seconds + aeron.image-liveness-timeout = 9 seconds } } """).withFallback(ArterySpecSupport.defaultConfig) diff --git a/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala index fb144cfb23..83ab983db9 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala @@ -21,7 +21,7 @@ object HandshakeShouldDropCompressionTableSpec { val commonConfig = ConfigFactory.parseString(s""" akka { remote.artery.advanced.handshake-timeout = 10s - remote.artery.advanced.image-liveness-timeout = 7s + remote.artery.advanced.aeron.image-liveness-timeout = 7s remote.artery.advanced.compression { actor-refs { diff --git a/akka-remote/src/test/scala/akka/remote/ActorsLeakSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/ActorsLeakSpec.scala similarity index 83% rename from akka-remote/src/test/scala/akka/remote/ActorsLeakSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/ActorsLeakSpec.scala index 0301852f9b..8eadecdf8b 100644 --- a/akka-remote/src/test/scala/akka/remote/ActorsLeakSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/ActorsLeakSpec.scala @@ -2,15 +2,16 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic import java.util.concurrent.TimeoutException import akka.actor._ import akka.actor.dungeon.ChildrenContainer import akka.remote.transport.ThrottlerTransportAdapter.ForceDisassociate -import akka.testkit._ +import akka.remote.{ AddressUidExtension, RARP } import akka.testkit.TestActors.EchoActor +import akka.testkit._ import com.github.ghik.silencer.silent import com.typesafe.config.ConfigFactory @@ -21,15 +22,15 @@ import scala.concurrent.duration._ object ActorsLeakSpec { val config = ConfigFactory.parseString(""" - | akka.actor.provider = remote - | akka.remote.netty.tcp.applied-adapters = ["trttl"] - | #akka.remote.log-lifecycle-events = on - | akka.remote.transport-failure-detector.heartbeat-interval = 1 s - | akka.remote.transport-failure-detector.acceptable-heartbeat-pause = 3 s - | akka.remote.quarantine-after-silence = 3 s - | akka.test.filter-leeway = 12 s - | - |""".stripMargin) + akka.actor.provider = remote + akka.remote.artery.enabled = false + akka.remote.classic.netty.tcp.applied-adapters = ["trttl"] + #akka.remote.log-lifecycle-events = on + akka.remote.classic.transport-failure-detector.heartbeat-interval = 1 s + akka.remote.classic.transport-failure-detector.acceptable-heartbeat-pause = 3 s + akka.remote.classic.quarantine-after-silence = 3 s + akka.test.filter-leeway = 12 s + """) def collectLiveActors(root: Option[ActorRef]): immutable.Seq[ActorRef] = { @@ -84,7 +85,9 @@ class ActorsLeakSpec extends AkkaSpec(ActorsLeakSpec.config) with ImplicitSender for (_ <- 1 to 3) { val remoteSystem = - ActorSystem("remote", ConfigFactory.parseString("akka.remote.netty.tcp.port = 0").withFallback(config)) + ActorSystem( + "remote", + ConfigFactory.parseString("akka.remote.classic.netty.tcp.port = 0").withFallback(config)) try { val probe = TestProbe()(remoteSystem) @@ -103,7 +106,12 @@ class ActorsLeakSpec extends AkkaSpec(ActorsLeakSpec.config) with ImplicitSender for (_ <- 1 to 3) { //always use the same address val remoteSystem = - ActorSystem("remote", ConfigFactory.parseString("akka.remote.netty.tcp.port = 2553").withFallback(config)) + ActorSystem( + "remote", + ConfigFactory.parseString(""" + akka.remote.artery.enabled = false + akka.remote.classic.netty.tcp.port = 2553 + """.stripMargin).withFallback(config)) try { val remoteAddress = RARP(remoteSystem).provider.getDefaultAddress @@ -142,7 +150,12 @@ class ActorsLeakSpec extends AkkaSpec(ActorsLeakSpec.config) with ImplicitSender for (_ <- 1 to 3) { val remoteSystem = - ActorSystem("remote", ConfigFactory.parseString("akka.remote.netty.tcp.port = 0").withFallback(config)) + ActorSystem( + "remote", + ConfigFactory.parseString(""" + akka.remote.artery.enabled = off + akka.remote.classic.netty.tcp.port = 0 + """.stripMargin).withFallback(config)) val remoteAddress = RARP(remoteSystem).provider.getDefaultAddress try { @@ -165,7 +178,7 @@ class ActorsLeakSpec extends AkkaSpec(ActorsLeakSpec.config) with ImplicitSender // Remote idle for too long case val remoteSystem = - ActorSystem("remote", ConfigFactory.parseString("akka.remote.netty.tcp.port = 0").withFallback(config)) + ActorSystem("remote", ConfigFactory.parseString("akka.remote.classic.netty.tcp.port = 0").withFallback(config)) val remoteAddress = RARP(remoteSystem).provider.getDefaultAddress remoteSystem.actorOf(Props[StoppableActor], "stoppable") diff --git a/akka-remote/src/test/scala/akka/remote/RemoteDeathWatchSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteDeathWatchSpec.scala similarity index 87% rename from akka-remote/src/test/scala/akka/remote/RemoteDeathWatchSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/RemoteDeathWatchSpec.scala index 9cbdd0afe5..013b1cb9d5 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteDeathWatchSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteDeathWatchSpec.scala @@ -2,17 +2,16 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic -import akka.testkit._ -import akka.actor._ +import akka.actor.{ RootActorPath, _ } +import akka.event.Logging.Warning +import akka.remote.{ QuarantinedEvent, RARP, RemoteActorRef } +import akka.testkit.{ SocketUtil, _ } +import com.github.ghik.silencer.silent import com.typesafe.config.ConfigFactory -import akka.actor.RootActorPath import scala.concurrent.duration._ -import akka.testkit.SocketUtil -import akka.event.Logging.Warning -import com.github.ghik.silencer.silent class RemoteDeathWatchSpec extends AkkaSpec(ConfigFactory.parseString(""" @@ -23,11 +22,14 @@ akka { /watchers.remote = "akka.tcp://other@localhost:2666" } } - remote.retry-gate-closed-for = 1 s - remote.initial-system-message-delivery-timeout = 3 s - remote.netty.tcp { + remote.artery.enabled = off + remote.classic { + retry-gate-closed-for = 1 s + initial-system-message-delivery-timeout = 3 s + netty.tcp { hostname = "localhost" port = 0 + } } } """)) @@ -41,7 +43,11 @@ akka { val other = ActorSystem( "other", - ConfigFactory.parseString("akka.remote.netty.tcp.port=2666").withFallback(system.settings.config)) + ConfigFactory.parseString(""" + akka.loglevel = DEBUG + akka.remote.artery.enabled = off + akka.remote.classic.netty.tcp.port=2666 + """).withFallback(system.settings.config)) override def beforeTermination(): Unit = { system.eventStream.publish(TestEvent.Mute(EventFilter.warning(pattern = "received dead letter.*Disassociate"))) diff --git a/akka-remote/src/test/scala/akka/remote/RemoteDeploymentWhitelistSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala similarity index 90% rename from akka-remote/src/test/scala/akka/remote/RemoteDeploymentWhitelistSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala index 0196314437..250615f3a4 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteDeploymentWhitelistSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala @@ -2,15 +2,17 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic import akka.actor._ +import akka.remote.EndpointException import akka.remote.transport._ import akka.testkit._ import com.typesafe.config._ import scala.concurrent.duration._ +// relies on test transport object RemoteDeploymentWhitelistSpec { class EchoWhitelisted extends Actor { @@ -54,16 +56,22 @@ object RemoteDeploymentWhitelistSpec { actor.provider = remote remote { - enabled-transports = [ + classic.enabled-transports = [ "akka.remote.test", - "akka.remote.netty.tcp" + "akka.remote.classic.netty.tcp" ] - - netty.tcp = { - port = 0 - hostname = "localhost" + + classic { + netty.tcp = { + port = 0 + hostname = "localhost" + } } - + + artery { + enabled = off + } + test { transport-class = "akka.remote.transport.TestTransport" applied-adapters = [] @@ -99,6 +107,7 @@ class RemoteDeploymentWhitelistSpec val conf = ConfigFactory.parseString(""" + akka.loglevel = DEBUG akka.remote.test { local-address = "test://remote-sys@localhost:12346" maximum-payload-bytes = 48000 bytes @@ -110,7 +119,7 @@ class RemoteDeploymentWhitelistSpec whitelist = [ "NOT_ON_CLASSPATH", # verify we don't throw if a class not on classpath is listed here - "akka.remote.RemoteDeploymentWhitelistSpec.EchoWhitelisted" + "akka.remote.classic.RemoteDeploymentWhitelistSpec.EchoWhitelisted" ] } //#whitelist-config diff --git a/akka-remote/src/test/scala/akka/remote/RemoteInitErrorSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteInitErrorSpec.scala similarity index 87% rename from akka-remote/src/test/scala/akka/remote/RemoteInitErrorSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/RemoteInitErrorSpec.scala index 1bf88bda40..1a09383fa6 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteInitErrorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteInitErrorSpec.scala @@ -2,7 +2,7 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic import akka.actor.ActorSystem import com.typesafe.config.ConfigFactory @@ -26,12 +26,13 @@ class RemoteInitErrorSpec extends WordSpec with Matchers { actor { provider = remote } + remote.artery.enabled = false remote { - enabled-transports = ["akka.remote.netty.tcp"] - netty.tcp { - hostname = "192.0.2.1" - port = 12344 - } + enabled-transports = ["akka.remote.classic.netty.tcp"] + classic.netty.tcp { + hostname = "192.0.2.1" + port = 12344 + } } } """).resolve() diff --git a/akka-remote/src/test/scala/akka/remote/RemoteSettingsSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteSettingsSpec.scala similarity index 63% rename from akka-remote/src/test/scala/akka/remote/RemoteSettingsSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/RemoteSettingsSpec.scala index fbab6cd005..e4007edbe3 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteSettingsSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteSettingsSpec.scala @@ -2,22 +2,23 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic +import akka.remote.RemoteSettings import com.typesafe.config.ConfigFactory import org.scalatest.{ Matchers, WordSpec } class RemoteSettingsSpec extends WordSpec with Matchers { "Remote settings" must { - "default akka.remote.log-frame-size-exceeding to off" in { + "default akka.remote.classic.log-frame-size-exceeding to off" in { new RemoteSettings(ConfigFactory.load()).LogFrameSizeExceeding shouldEqual None } - "parse akka.remote.log-frame-size-exceeding value as bytes" in { + "parse akka.remote.classic.log-frame-size-exceeding value as bytes" in { new RemoteSettings( ConfigFactory - .parseString("akka.remote.log-frame-size-exceeding = 100b") + .parseString("akka.remote.classic.log-frame-size-exceeding = 100b") .withFallback(ConfigFactory.load())).LogFrameSizeExceeding shouldEqual Some(100) } } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteWatcherSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteWatcherSpec.scala similarity index 98% rename from akka-remote/src/test/scala/akka/remote/RemoteWatcherSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/RemoteWatcherSpec.scala index a82fd5de28..639af4180c 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteWatcherSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteWatcherSpec.scala @@ -2,14 +2,16 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic -import language.postfixOps -import scala.concurrent.duration._ -import akka.testkit._ import akka.actor._ +import akka.remote._ +import akka.testkit._ import com.github.ghik.silencer.silent +import scala.concurrent.duration._ +import scala.language.postfixOps + object RemoteWatcherSpec { class TestActorProxy(testActor: ActorRef) extends Actor { @@ -69,14 +71,15 @@ class RemoteWatcherSpec extends AkkaSpec("""akka { loglevel = INFO log-dead-letters-during-shutdown = false actor.provider = remote - remote.netty.tcp { + remote.classic.netty.tcp { hostname = localhost port = 0 } + remote.artery.enabled = off }""") with ImplicitSender { - import RemoteWatcherSpec._ import RemoteWatcher._ + import RemoteWatcherSpec._ override def expectedTestDuration = 2.minutes diff --git a/akka-remote/src/test/scala/akka/remote/RemotingSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemotingSpec.scala similarity index 92% rename from akka-remote/src/test/scala/akka/remote/RemotingSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/RemotingSpec.scala index 70b9d08f75..bf2e64ff04 100644 --- a/akka-remote/src/test/scala/akka/remote/RemotingSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemotingSpec.scala @@ -2,26 +2,26 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic + +import java.io.NotSerializableException +import java.util.concurrent.ThreadLocalRandom import akka.actor._ import akka.event.AddressTerminatedTopic import akka.pattern.ask import akka.remote.transport.AssociationHandle.{ HandleEvent, HandleEventListener } -import akka.remote.transport._ import akka.remote.transport.Transport.InvalidAssociationException +import akka.remote.transport._ +import akka.remote._ +import akka.testkit.SocketUtil.temporaryServerAddress import akka.testkit._ import akka.util.ByteString -import com.typesafe.config._ -import java.io.NotSerializableException - -import scala.concurrent.Await -import scala.concurrent.Future -import scala.concurrent.duration._ -import java.util.concurrent.ThreadLocalRandom - -import akka.testkit.SocketUtil.temporaryServerAddress import com.github.ghik.silencer.silent +import com.typesafe.config._ + +import scala.concurrent.{ Await, Future } +import scala.concurrent.duration._ object RemotingSpec { @@ -90,28 +90,29 @@ object RemotingSpec { actor.serialize-messages = off remote { - retry-gate-closed-for = 1 s - log-remote-lifecycle-events = on + artery.enabled = off + classic { + retry-gate-closed-for = 1 s + log-remote-lifecycle-events = on - enabled-transports = [ - "akka.remote.test", - "akka.remote.netty.tcp", - "akka.remote.netty.udp", - "akka.remote.netty.ssl" - ] + enabled-transports = [ + "akka.remote.classic.test", + "akka.remote.classic.netty.tcp", + "akka.remote.classic.netty.ssl" + ] - netty.tcp = $${common-netty-settings} - netty.udp = $${common-netty-settings} - netty.ssl = $${common-netty-settings} - netty.ssl.security = $${common-ssl-settings} + netty.tcp = $${common-netty-settings} + netty.ssl = $${common-netty-settings} + netty.ssl.security = $${common-ssl-settings} - test { - transport-class = "akka.remote.transport.TestTransport" - applied-adapters = [] - registry-key = aX33k0jWKg - local-address = "test://RemotingSpec@localhost:12345" - maximum-payload-bytes = 32000 bytes - scheme-identifier = test + test { + transport-class = "akka.remote.transport.TestTransport" + applied-adapters = [] + registry-key = aX33k0jWKg + local-address = "test://RemotingSpec@localhost:12345" + maximum-payload-bytes = 32000 bytes + scheme-identifier = test + } } } @@ -140,14 +141,15 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D import RemotingSpec._ val conf = ConfigFactory.parseString(""" - akka.remote.test { + akka.remote.artery.enabled = false + akka.remote.classic.test { local-address = "test://remote-sys@localhost:12346" maximum-payload-bytes = 48000 bytes } """).withFallback(system.settings.config).resolve() val remoteSystem = ActorSystem("remote-sys", conf) - for ((name, proto) <- Seq("/gonk" -> "tcp", "/zagzag" -> "udp", "/roghtaar" -> "ssl.tcp")) + for ((name, proto) <- Seq("/gonk" -> "tcp", "/roghtaar" -> "ssl.tcp")) deploy(system, Deploy(name, scope = RemoteScope(getOtherAddress(remoteSystem, proto)))) def getOtherAddress(sys: ActorSystem, proto: String) = @@ -201,7 +203,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D private def byteStringOfSize(size: Int) = ByteString.fromArray(Array.fill(size)(42: Byte)) - val maxPayloadBytes = system.settings.config.getBytes("akka.remote.test.maximum-payload-bytes").toInt + val maxPayloadBytes = system.settings.config.getBytes("akka.remote.classic.test.maximum-payload-bytes").toInt override def afterTermination(): Unit = { shutdown(remoteSystem) @@ -238,7 +240,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D "not be exhausted by sending to broken connections" in { val tcpOnlyConfig = ConfigFactory - .parseString("""akka.remote.enabled-transports = ["akka.remote.netty.tcp"]""") + .parseString("""akka.remote.enabled-transports = ["akka.remote.classic.netty.tcp"]""") .withFallback(remoteSystem.settings.config) val moreSystems = Vector.fill(5)(ActorSystem(remoteSystem.name, tcpOnlyConfig)) moreSystems.foreach { sys => @@ -490,22 +492,6 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D expectMsg("postStop") } - "be able to use multiple transports and use the appropriate one (UDP)" in { - val r = system.actorOf(Props[Echo1], "zagzag") - r.path.toString should ===( - s"akka.udp://remote-sys@localhost:${port(remoteSystem, "udp")}/remote/akka.udp/RemotingSpec@localhost:${port(system, "udp")}/user/zagzag") - r ! 42 - expectMsg(10.seconds, 42) - EventFilter[Exception]("crash", occurrences = 1).intercept { - r ! new Exception("crash") - } - expectMsg("preRestart") - r ! 42 - expectMsg(42) - system.stop(r) - expectMsg("postStop") - } - "be able to use multiple transports and use the appropriate one (SSL)" in { val r = system.actorOf(Props[Echo1], "roghtaar") r.path.toString should ===( @@ -566,8 +552,8 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D # Additional internal serialization verification need so be off, otherwise it triggers two error messages # instead of one: one for the internal check, and one for the actual remote send -- tripping off this test akka.actor.serialize-messages = off - akka.remote.enabled-transports = ["akka.remote.test", "akka.remote.netty.tcp"] - akka.remote.test.local-address = "test://other-system@localhost:12347" + akka.remote.classic.enabled-transports = ["akka.remote.classic.test", "akka.remote.classic.netty.tcp"] + akka.remote.classic.test.local-address = "test://other-system@localhost:12347" """) .withFallback(remoteSystem.settings.config) val otherSystem = ActorSystem("other-system", config) @@ -602,10 +588,10 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D val remoteAddress = Address("akka.test", "system2", "localhost", 2) val config = ConfigFactory.parseString(s""" - akka.remote.enabled-transports = ["akka.remote.test"] + akka.remote.enabled-transports = ["akka.remote.classic.test"] akka.remote.retry-gate-closed-for = 5s - akka.remote.test { + akka.remote.classic.test { registry-key = tFdVxq local-address = "test://${localAddress.system}@${localAddress.host.get}:${localAddress.port.get}" } @@ -660,11 +646,11 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D val rawRemoteAddress = remoteAddress.copy(protocol = "test") val config = ConfigFactory.parseString(s""" - akka.remote.enabled-transports = ["akka.remote.test"] - akka.remote.retry-gate-closed-for = 5s - akka.remote.log-remote-lifecycle-events = on + akka.remote.classic.enabled-transports = ["akka.remote.classic.test"] + akka.remote.classic.retry-gate-closed-for = 5s + akka.remote.classic.log-remote-lifecycle-events = on - akka.remote.test { + akka.remote.classic.test { registry-key = TRKAzR local-address = "test://${localAddress.system}@${localAddress.host.get}:${localAddress.port.get}" } @@ -742,11 +728,11 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D val remoteUID = 16 val config = ConfigFactory.parseString(s""" - akka.remote.enabled-transports = ["akka.remote.test"] - akka.remote.retry-gate-closed-for = 5s - akka.remote.log-remote-lifecycle-events = on + akka.remote.classic.enabled-transports = ["akka.remote.classic.test"] + akka.remote.classic.retry-gate-closed-for = 5s + akka.remote.classic.log-remote-lifecycle-events = on - akka.remote.test { + akka.remote.classic.test { registry-key = JMeMndLLsw local-address = "test://${localAddress.system}@${localAddress.host.get}:${localAddress.port.get}" } @@ -820,8 +806,8 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D "be able to connect to system even if it's not there at first" in { val config = ConfigFactory.parseString(s""" - akka.remote.enabled-transports = ["akka.remote.netty.tcp"] - akka.remote.netty.tcp.port = 0 + akka.remote.enabled-transports = ["akka.remote.classic.netty.tcp"] + akka.remote.classic.netty.tcp.port = 0 akka.remote.retry-gate-closed-for = 5s """).withFallback(remoteSystem.settings.config) val thisSystem = ActorSystem("this-system", config) @@ -831,7 +817,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D val probeSender = probe.ref val otherAddress = temporaryServerAddress() val otherConfig = ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${otherAddress.getPort} + akka.remote.classic.netty.tcp.port = ${otherAddress.getPort} """).withFallback(config) val otherSelection = thisSystem.actorSelection(s"akka.tcp://other-system@localhost:${otherAddress.getPort}/user/echo") @@ -858,8 +844,8 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D "allow other system to connect even if it's not there at first" in { val config = ConfigFactory.parseString(s""" - akka.remote.enabled-transports = ["akka.remote.netty.tcp"] - akka.remote.netty.tcp.port = 0 + akka.remote.enabled-transports = ["akka.remote.classic.netty.tcp"] + akka.remote.classic.netty.tcp.port = 0 akka.remote.retry-gate-closed-for = 5s """).withFallback(remoteSystem.settings.config) val thisSystem = ActorSystem("this-system", config) @@ -870,7 +856,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D thisSystem.actorOf(Props[Echo2], "echo") val otherAddress = temporaryServerAddress() val otherConfig = ConfigFactory.parseString(s""" - akka.remote.netty.tcp.port = ${otherAddress.getPort} + akka.remote.classic.netty.tcp.port = ${otherAddress.getPort} """).withFallback(config) val otherSelection = thisSystem.actorSelection(s"akka.tcp://other-system@localhost:${otherAddress.getPort}/user/echo") diff --git a/akka-remote/src/test/scala/akka/remote/UntrustedSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/UntrustedSpec.scala similarity index 93% rename from akka-remote/src/test/scala/akka/remote/UntrustedSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/UntrustedSpec.scala index 149f2dfa36..80988f0b76 100644 --- a/akka-remote/src/test/scala/akka/remote/UntrustedSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/UntrustedSpec.scala @@ -2,7 +2,7 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote +package akka.remote.classic import scala.concurrent.duration._ import com.typesafe.config.ConfigFactory @@ -60,10 +60,12 @@ object UntrustedSpec { } class UntrustedSpec extends AkkaSpec(""" + akka.loglevel = DEBUG akka.actor.provider = remote +akka.remote.artery.enabled = off akka.remote.warn-about-direct-use = off -akka.remote.untrusted-mode = on -akka.remote.trusted-selection-paths = ["/user/receptionist", ] +akka.remote.classic.untrusted-mode = on +akka.remote.classic.trusted-selection-paths = ["/user/receptionist", ] akka.remote.netty.tcp.port = 0 akka.loglevel = DEBUG # test verifies debug """) with ImplicitSender { @@ -73,9 +75,11 @@ akka.loglevel = DEBUG # test verifies debug val client = ActorSystem( "UntrustedSpec-client", ConfigFactory.parseString(""" + akka.loglevel = DEBUG akka.actor.provider = remote + akka.remote.artery.enabled = off akka.remote.warn-about-direct-use = off - akka.remote.netty.tcp.port = 0 + akka.remote.classic.netty.tcp.port = 0 """)) val address = system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress diff --git a/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/AkkaProtocolSpec.scala similarity index 90% rename from akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/AkkaProtocolSpec.scala index 851159d155..5f99ab15d9 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/AkkaProtocolSpec.scala @@ -2,28 +2,31 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport -import akka.actor.{ Address } +import java.util.concurrent.TimeoutException + +import akka.actor.Address +import akka.protobuf.{ ByteString => PByteString } +import akka.remote.classic.transport.AkkaProtocolSpec.TestFailureDetector import akka.remote.transport.AkkaPduCodec.{ Associate, Disassociate, Heartbeat } -import akka.remote.transport.AkkaProtocolSpec.TestFailureDetector import akka.remote.transport.AssociationHandle.{ ActorHandleEventListener, DisassociateInfo, Disassociated, InboundPayload } +import akka.remote.transport.ProtocolStateActor import akka.remote.transport.TestTransport._ import akka.remote.transport.Transport._ +import akka.remote.transport.{ AssociationRegistry => _, _ } import akka.remote.{ FailureDetector, WireFormats } import akka.testkit.{ AkkaSpec, ImplicitSender } -import akka.util.ByteString -import akka.protobuf.{ ByteString => PByteString } +import akka.util.{ ByteString, OptionVal } import com.typesafe.config.ConfigFactory + import scala.concurrent.duration._ import scala.concurrent.{ Await, Promise } -import java.util.concurrent.TimeoutException -import akka.util.OptionVal object AkkaProtocolSpec { @@ -44,25 +47,24 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = remote """) wit val conf = ConfigFactory.parseString(""" akka.remote { - transport-failure-detector { - implementation-class = "akka.remote.PhiAccrualFailureDetector" - max-sample-size = 100 - min-std-deviation = 100 ms - acceptable-heartbeat-pause = 3 s - heartbeat-interval = 1 s + + + classic { + backoff-interval = 1 s + require-cookie = off + secure-cookie = "abcde" + shutdown-timeout = 5 s + startup-timeout = 5 s + use-passive-connections = on + transport-failure-detector { + implementation-class = "akka.remote.PhiAccrualFailureDetector" + max-sample-size = 100 + min-std-deviation = 100 ms + acceptable-heartbeat-pause = 3 s + heartbeat-interval = 1 s + } } - backoff-interval = 1 s - - require-cookie = off - - secure-cookie = "abcde" - - shutdown-timeout = 5 s - - startup-timeout = 5 s - - use-passive-connections = on } """).withFallback(system.settings.config) @@ -89,7 +91,7 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = remote """) wit def collaborators = { val registry = new AssociationRegistry val transport: TestTransport = new TestTransport(localAddress, registry) - val handle: TestAssociationHandle = new TestAssociationHandle(localAddress, remoteAddress, transport, true) + val handle: TestAssociationHandle = TestAssociationHandle(localAddress, remoteAddress, transport, true) // silently drop writes -- we do not have another endpoint under test, so nobody to forward to transport.writeBehavior.pushConstant(true) @@ -257,7 +259,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = remote """) wit HandshakeInfo(origin = localAddress, uid = 42, cookie = Some("abcde")), handle, ActorAssociationEventListener(testActor), - new AkkaProtocolSettings(ConfigFactory.parseString("akka.remote.require-cookie = on").withFallback(conf)), + new AkkaProtocolSettings( + ConfigFactory.parseString("akka.remote.classic.require-cookie = on").withFallback(conf)), codec, failureDetector)) @@ -277,7 +280,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = remote """) wit HandshakeInfo(origin = localAddress, uid = 42, cookie = Some("abcde")), handle, ActorAssociationEventListener(testActor), - new AkkaProtocolSettings(ConfigFactory.parseString("akka.remote.require-cookie = on").withFallback(conf)), + new AkkaProtocolSettings( + ConfigFactory.parseString("akka.remote.classic.require-cookie = on").withFallback(conf)), codec, failureDetector)) @@ -311,7 +315,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = remote """) wit remoteAddress, statusPromise, transport, - new AkkaProtocolSettings(ConfigFactory.parseString("akka.remote.require-cookie = on").withFallback(conf)), + new AkkaProtocolSettings( + ConfigFactory.parseString("akka.remote.classic.require-cookie = on").withFallback(conf)), codec, failureDetector, refuseUid = None)) @@ -478,7 +483,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = remote """) wit val statusPromise: Promise[AssociationHandle] = Promise() - val conf2 = ConfigFactory.parseString("akka.remote.netty.tcp.connection-timeout = 500 ms").withFallback(conf) + val conf2 = + ConfigFactory.parseString("akka.remote.classic.netty.tcp.connection-timeout = 500 ms").withFallback(conf) val stateActor = system.actorOf( ProtocolStateActor.outboundProps( @@ -501,7 +507,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = remote """) wit "give up inbound after connection timeout" in { val (failureDetector, _, _, handle) = collaborators - val conf2 = ConfigFactory.parseString("akka.remote.netty.tcp.connection-timeout = 500 ms").withFallback(conf) + val conf2 = + ConfigFactory.parseString("akka.remote.classic.netty.tcp.connection-timeout = 500 ms").withFallback(conf) val reader = system.actorOf( ProtocolStateActor.inboundProps( diff --git a/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolStressTest.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/AkkaProtocolStressTest.scala similarity index 92% rename from akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolStressTest.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/AkkaProtocolStressTest.scala index 703f458630..d08afd979d 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolStressTest.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/AkkaProtocolStressTest.scala @@ -2,17 +2,17 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport -import akka.testkit.{ AkkaSpec, DefaultTimeout, ImplicitSender, TimingTest } -import com.typesafe.config.{ Config, ConfigFactory } -import AkkaProtocolStressTest._ import akka.actor._ -import scala.concurrent.duration._ -import akka.testkit._ -import akka.remote.{ EndpointException, RARP } +import akka.remote.classic.transport.AkkaProtocolStressTest._ import akka.remote.transport.FailureInjectorTransportAdapter.{ Drop, One } +import akka.remote.{ EndpointException, RARP } +import akka.testkit.{ AkkaSpec, DefaultTimeout, ImplicitSender, TimingTest, _ } +import com.typesafe.config.{ Config, ConfigFactory } + import scala.concurrent.Await +import scala.concurrent.duration._ object AkkaProtocolStressTest { val configA: Config = @@ -21,10 +21,11 @@ object AkkaProtocolStressTest { #loglevel = DEBUG actor.serialize-messages = off actor.provider = remote + remote.artery.enabled = off - remote.log-remote-lifecycle-events = on + remote.classic.log-remote-lifecycle-events = on - remote.transport-failure-detector { + remote.classic.transport-failure-detector { max-sample-size = 2 min-std-deviation = 1 ms ## We want lots of lost connections in this test, keep it sensitive @@ -32,9 +33,9 @@ object AkkaProtocolStressTest { acceptable-heartbeat-pause = 1 s } ## Keep gate duration in this test for a low value otherwise too much messages are dropped - remote.retry-gate-closed-for = 100 ms + remote.classic.retry-gate-closed-for = 100 ms - remote.netty.tcp { + remote.classic.netty.tcp { applied-adapters = ["gremlin"] port = 0 } diff --git a/akka-remote/src/test/scala/akka/remote/transport/GenericTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/GenericTransportSpec.scala similarity index 96% rename from akka-remote/src/test/scala/akka/remote/transport/GenericTransportSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/GenericTransportSpec.scala index 07a784d5ac..7f3e0fe2f7 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/GenericTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/GenericTransportSpec.scala @@ -2,20 +2,24 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport import akka.actor.{ Address, ExtendedActorSystem } +import akka.remote.RemoteActorRefProvider import akka.remote.transport.AssociationHandle.{ ActorHandleEventListener, Disassociated, InboundPayload } -import akka.remote.transport.TestTransport._ +import akka.remote.transport.TestTransport.{ AssociateAttempt, DisassociateAttempt, ListenAttempt, WriteAttempt, _ } import akka.remote.transport.Transport._ +import akka.remote.transport.{ AssociationRegistry => _, _ } import akka.testkit.{ AkkaSpec, DefaultTimeout, ImplicitSender } import akka.util.ByteString + import scala.concurrent.{ Await, Future } -import akka.remote.RemoteActorRefProvider -import akka.remote.transport.TestTransport.{ AssociateAttempt, DisassociateAttempt, ListenAttempt, WriteAttempt } abstract class GenericTransportSpec(withAkkaProtocol: Boolean = false) - extends AkkaSpec("""akka.actor.provider = remote """) + extends AkkaSpec(""" + akka.remote.artery.enabled = false + akka.actor.provider = remote + """) with DefaultTimeout with ImplicitSender { diff --git a/akka-remote/src/test/scala/akka/remote/transport/SwitchableLoggedBehaviorSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/SwitchableLoggedBehaviorSpec.scala similarity index 96% rename from akka-remote/src/test/scala/akka/remote/transport/SwitchableLoggedBehaviorSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/SwitchableLoggedBehaviorSpec.scala index 0c4f82dc0a..01e2616d4a 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/SwitchableLoggedBehaviorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/SwitchableLoggedBehaviorSpec.scala @@ -2,13 +2,14 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport -import akka.testkit.{ AkkaSpec, DefaultTimeout } +import akka.AkkaException import akka.remote.transport.TestTransport.SwitchableLoggedBehavior +import akka.testkit.{ AkkaSpec, DefaultTimeout } + import scala.concurrent.{ Await, Future, Promise } import scala.util.Failure -import akka.AkkaException import scala.util.control.NoStackTrace object SwitchableLoggedBehaviorSpec { @@ -16,7 +17,7 @@ object SwitchableLoggedBehaviorSpec { } class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout { - import akka.remote.transport.SwitchableLoggedBehaviorSpec._ + import akka.remote.classic.transport.SwitchableLoggedBehaviorSpec._ private def defaultBehavior = new SwitchableLoggedBehavior[Unit, Int]((_) => Future.successful(3), (_) => ()) diff --git a/akka-remote/src/test/scala/akka/remote/transport/SystemMessageDeliveryStressTest.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/SystemMessageDeliveryStressTest.scala similarity index 81% rename from akka-remote/src/test/scala/akka/remote/transport/SystemMessageDeliveryStressTest.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/SystemMessageDeliveryStressTest.scala index 1f9352c977..a8df71000d 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/SystemMessageDeliveryStressTest.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/SystemMessageDeliveryStressTest.scala @@ -2,32 +2,19 @@ * Copyright (C) 2009-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport -import akka.remote.transport.ThrottlerTransportAdapter._ -import akka.testkit.TimingTest -import akka.testkit.DefaultTimeout -import akka.testkit.ImplicitSender -import akka.testkit.{ AkkaSpec, DefaultTimeout, ImplicitSender, TimingTest } -import com.typesafe.config.{ Config, ConfigFactory } -import akka.actor._ -import scala.concurrent.duration._ -import akka.testkit._ -import akka.remote.{ EndpointException, QuarantinedEvent, RARP } -import akka.remote.transport.FailureInjectorTransportAdapter.{ Drop, One } -import scala.concurrent.Await -import akka.actor.ActorRef -import akka.actor.Actor -import akka.testkit.AkkaSpec -import akka.actor.ActorSystem -import akka.actor.Props -import akka.actor.ExtendedActorSystem -import akka.actor.RootActorPath -import akka.remote.transport.FailureInjectorTransportAdapter.One -import akka.remote.transport.FailureInjectorTransportAdapter.Drop -import akka.testkit.TestEvent -import akka.testkit.EventFilter +import akka.actor.{ Actor, ActorRef, ActorSystem, ExtendedActorSystem, Props, RootActorPath, _ } import akka.dispatch.sysmsg.{ Failed, SystemMessage } +import akka.remote.transport.AssociationHandle +import akka.remote.transport.FailureInjectorTransportAdapter.{ Drop, One } +import akka.remote.transport.ThrottlerTransportAdapter._ +import akka.remote.{ EndpointException, QuarantinedEvent, RARP } +import akka.testkit.{ AkkaSpec, DefaultTimeout, EventFilter, ImplicitSender, TestEvent, TimingTest, _ } +import com.typesafe.config.{ Config, ConfigFactory } + +import scala.concurrent.Await +import scala.concurrent.duration._ object SystemMessageDeliveryStressTest { val msgCount = 5000 @@ -37,23 +24,28 @@ object SystemMessageDeliveryStressTest { val baseConfig: Config = ConfigFactory.parseString(s""" akka { #loglevel = DEBUG + remote.artery.enabled = false actor.provider = remote actor.serialize-messages = off - remote.log-remote-lifecycle-events = on - - remote.transport-failure-detector { - heartbeat-interval = 1 s - acceptable-heartbeat-pause = 5 s + remote.classic { + log-remote-lifecycle-events = on + system-message-buffer-size = $msgCount + resend-interval = 2 s + use-passive-connections = on + initial-system-message-delivery-timeout = 10 m + ## Keep this setting tight, otherwise the test takes a long time or times out + system-message-ack-piggyback-timeout = 100 ms // Force heavy Ack traffic + + transport-failure-detector { + heartbeat-interval = 1 s + acceptable-heartbeat-pause = 5 s + } } - remote.system-message-buffer-size = $msgCount - ## Keep this setting tight, otherwise the test takes a long time or times out - remote.resend-interval = 2 s - remote.system-message-ack-piggyback-timeout = 100 ms // Force heavy Ack traffic - remote.initial-system-message-delivery-timeout = 10 m - remote.use-passive-connections = on - remote.netty.tcp { + + + remote.classic.netty.tcp { applied-adapters = ["gremlin", "trttl"] port = 0 } @@ -196,9 +188,11 @@ abstract class SystemMessageDeliveryStressTest(msg: String, cfg: String) } class SystemMessageDeliveryRetryGate - extends SystemMessageDeliveryStressTest("passive connections on", "akka.remote.retry-gate-closed-for = 0.5 s") + extends SystemMessageDeliveryStressTest( + "passive connections on", + """akka.remote.classic.retry-gate-closed-for = 0.5 s""") class SystemMessageDeliveryNoPassiveRetryGate extends SystemMessageDeliveryStressTest("passive connections off", """ - akka.remote.use-passive-connections = off - akka.remote.retry-gate-closed-for = 0.5 s + akka.remote.classic.use-passive-connections = off + akka.remote.classic.retry-gate-closed-for = 0.5 s """) diff --git a/akka-remote/src/test/scala/akka/remote/transport/TestTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/TestTransportSpec.scala similarity index 98% rename from akka-remote/src/test/scala/akka/remote/transport/TestTransportSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/TestTransportSpec.scala index 4e4081a553..fa78c1b1d9 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/TestTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/TestTransportSpec.scala @@ -2,15 +2,17 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport -import akka.testkit._ -import scala.concurrent._ import akka.actor.Address -import akka.remote.transport.Transport._ -import akka.remote.transport.TestTransport._ -import akka.util.ByteString import akka.remote.transport.AssociationHandle.{ ActorHandleEventListener, Disassociated, InboundPayload } +import akka.remote.transport.TestTransport._ +import akka.remote.transport.Transport._ +import akka.remote.transport.{ AssociationHandle, TestTransport } +import akka.testkit._ +import akka.util.ByteString + +import scala.concurrent._ class TestTransportSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { diff --git a/akka-remote/src/test/scala/akka/remote/transport/ThrottleModeSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottleModeSpec.scala similarity index 99% rename from akka-remote/src/test/scala/akka/remote/transport/ThrottleModeSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/ThrottleModeSpec.scala index 99682ffb9e..6a9d5109f5 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/ThrottleModeSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottleModeSpec.scala @@ -2,12 +2,13 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport -import akka.testkit.AkkaSpec -import akka.remote.transport.ThrottlerTransportAdapter.{ TokenBucket, Unthrottled } import java.util.concurrent.TimeUnit +import akka.remote.transport.ThrottlerTransportAdapter.{ TokenBucket, Unthrottled } +import akka.testkit.AkkaSpec + class ThrottleModeSpec extends AkkaSpec { val halfSecond: Long = TimeUnit.MILLISECONDS.toNanos(500) diff --git a/akka-remote/src/test/scala/akka/remote/transport/ThrottlerTransportAdapterSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottlerTransportAdapterSpec.scala similarity index 87% rename from akka-remote/src/test/scala/akka/remote/transport/ThrottlerTransportAdapterSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/ThrottlerTransportAdapterSpec.scala index fa62443c0a..44ff064e3a 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/ThrottlerTransportAdapterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottlerTransportAdapterSpec.scala @@ -2,33 +2,34 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport +package akka.remote.classic.transport -import com.typesafe.config.{ Config, ConfigFactory } import akka.actor._ -import akka.testkit.{ AkkaSpec, DefaultTimeout, ImplicitSender, TimingTest } -import ThrottlerTransportAdapterSpec._ -import scala.concurrent.duration._ -import scala.concurrent.Await +import akka.remote.classic.transport.ThrottlerTransportAdapterSpec._ import akka.remote.transport.ThrottlerTransportAdapter._ -import akka.remote.RemoteActorRefProvider -import akka.testkit.TestEvent -import akka.testkit.EventFilter -import akka.remote.EndpointException +import akka.remote.transport.{ TestTransport, ThrottlerTransportAdapter } +import akka.remote.{ EndpointException, RemoteActorRefProvider } +import akka.testkit.{ AkkaSpec, DefaultTimeout, EventFilter, ImplicitSender, TestEvent, TimingTest } +import com.typesafe.config.{ Config, ConfigFactory } + +import scala.concurrent.Await +import scala.concurrent.duration._ object ThrottlerTransportAdapterSpec { - val configA: Config = ConfigFactory.parseString(""" + val configA: Config = + ConfigFactory.parseString(""" akka { actor.provider = remote - remote.netty.tcp.hostname = "localhost" + remote.artery.enabled = off + remote.classic.netty.tcp.hostname = "localhost" remote.log-remote-lifecycle-events = off remote.retry-gate-closed-for = 1 s - remote.transport-failure-detector.heartbeat-interval = 1 s - remote.transport-failure-detector.acceptable-heartbeat-pause = 3 s + remote.classic.transport-failure-detector.heartbeat-interval = 1 s + remote.classic.transport-failure-detector.acceptable-heartbeat-pause = 3 s - remote.netty.tcp.applied-adapters = ["trttl"] - remote.netty.tcp.port = 0 + remote.classic.netty.tcp.applied-adapters = ["trttl"] + remote.classic.netty.tcp.port = 0 } """) diff --git a/akka-remote/src/test/scala/akka/remote/transport/netty/NettyTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala similarity index 75% rename from akka-remote/src/test/scala/akka/remote/transport/netty/NettyTransportSpec.scala rename to akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala index bdaa2acf31..364ed6df4d 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/netty/NettyTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala @@ -2,14 +2,14 @@ * Copyright (C) 2018-2019 Lightbend Inc. */ -package akka.remote.transport.netty +package akka.remote.classic.transport.netty import java.net.{ InetAddress, InetSocketAddress } import java.nio.channels.ServerSocketChannel -import akka.testkit.SocketUtil import akka.actor.{ ActorSystem, Address, ExtendedActorSystem } import akka.remote.BoundAddressesExtension +import akka.testkit.SocketUtil import com.typesafe.config.ConfigFactory import org.scalatest.{ Matchers, WordSpec } @@ -39,16 +39,15 @@ object NettyTransportSpec { } class NettyTransportSpec extends WordSpec with Matchers with BindBehavior { - - import akka.remote.transport.netty.NettyTransportSpec._ + import NettyTransportSpec._ "NettyTransport" should { - behave.like(theOneWhoKnowsTheDifferenceBetweenBoundAndRemotingAddress("tcp")) - behave.like(theOneWhoKnowsTheDifferenceBetweenBoundAndRemotingAddress("udp")) + behave.like(theOneWhoKnowsTheDifferenceBetweenBoundAndRemotingAddress()) "bind to a random port" in { val bindConfig = ConfigFactory.parseString(s""" - akka.remote.netty.tcp { + akka.remote.artery.enabled = false + akka.remote.classic.netty.tcp { port = 0 } """) @@ -65,7 +64,8 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehavior { try { val bindConfig = ConfigFactory.parseString(s""" - akka.remote.netty.tcp { + akka.remote.artery.enabled = false + akka.remote.classic.netty.tcp { port = ${address.getPort} bind-port = 0 } @@ -92,7 +92,8 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehavior { val address = SocketUtil.temporaryServerAddress(InetAddress.getLocalHost.getHostAddress, udp = false) val bindConfig = ConfigFactory.parseString(s""" - akka.remote.netty.tcp { + akka.remote.artery.enabled = false + akka.remote.classic.netty.tcp { port = 0 bind-port = ${address.getPort} } @@ -105,25 +106,10 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehavior { Await.result(sys.terminate(), Duration.Inf) } - "bind to multiple transports" in { - val bindConfig = ConfigFactory.parseString(s""" - akka.remote { - netty.tcp.port = 0 - netty.udp.port = 0 - enabled-transports = ["akka.remote.netty.tcp", "akka.remote.netty.udp"] - } - """) - implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - - getInternal should contain(getExternal.withProtocol("tcp")) - getInternal.size should ===(2) - - Await.result(sys.terminate(), Duration.Inf) - } - "bind to all interfaces" in { val bindConfig = ConfigFactory.parseString(s""" - akka.remote { + akka.remote.artery.enabled = false + akka.remote.classic { netty.tcp.bind-hostname = "0.0.0.0" } """) @@ -140,33 +126,35 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehavior { trait BindBehavior { this: WordSpec with Matchers => - import akka.remote.transport.netty.NettyTransportSpec._ + import NettyTransportSpec._ - def theOneWhoKnowsTheDifferenceBetweenBoundAndRemotingAddress(proto: String) = { - s"bind to default $proto address" in { - val address = SocketUtil.temporaryServerAddress(udp = proto == "udp") + // TODO inline + def theOneWhoKnowsTheDifferenceBetweenBoundAndRemotingAddress() = { + s"bind to default tcp address" in { + val address = SocketUtil.temporaryServerAddress() val bindConfig = ConfigFactory.parseString(s""" - akka.remote { - netty.$proto { + akka.remote.artery.enabled = false + akka.remote.classic { + netty.tcp { hostname = ${address.getAddress.getHostAddress} port = ${address.getPort} } - enabled-transports = ["akka.remote.netty.$proto"] + enabled-transports = ["akka.remote.classic.netty.tcp"] } """) implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - getExternal should ===(address.toAkkaAddress(s"akka.$proto")) - getInternal should contain(address.toAkkaAddress(proto)) + getExternal should ===(address.toAkkaAddress(s"akka.tcp")) + getInternal should contain(address.toAkkaAddress("tcp")) Await.result(sys.terminate(), Duration.Inf) } - s"bind to specified $proto address" in { - val address = SocketUtil.temporaryServerAddress(address = "127.0.0.1", udp = proto == "udp") + s"bind to specified tcp address" in { + val address = SocketUtil.temporaryServerAddress(address = "127.0.0.1") val bindAddress = - try SocketUtil.temporaryServerAddress(address = "127.0.1.1", udp = proto == "udp") + try SocketUtil.temporaryServerAddress(address = "127.0.1.1") catch { case e: java.net.BindException => info(s"skipping test due to [${e.getMessage}], you probably have to use `ifconfig lo0 alias 127.0.1.1`") @@ -175,21 +163,22 @@ trait BindBehavior { } val bindConfig = ConfigFactory.parseString(s""" - akka.remote { - netty.$proto { + akka.remote.artery.enabled = false + akka.remote.classic { + netty.tcp { hostname = ${address.getAddress.getHostAddress} port = ${address.getPort} bind-hostname = ${bindAddress.getAddress.getHostAddress} bind-port = ${bindAddress.getPort} } - enabled-transports = ["akka.remote.netty.$proto"] + enabled-transports = ["akka.remote.classic.netty.tcp"] } """) implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - getExternal should ===(address.toAkkaAddress(s"akka.$proto")) - getInternal should contain(bindAddress.toAkkaAddress(proto)) + getExternal should ===(address.toAkkaAddress(s"akka.tcp")) + getInternal should contain(bindAddress.toAkkaAddress("tcp")) Await.result(sys.terminate(), Duration.Inf) } diff --git a/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala b/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala index ad03cfc849..debc2a1b9b 100644 --- a/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala @@ -103,6 +103,8 @@ class DaemonMsgCreateSerializerSpec extends AkkaSpec with SerializationVerificat val system = ActorSystem( "DaemonMsgCreateSerializer-old-wire-format", ConfigFactory.parseString(""" + # old hex bytes contain actor ref with akka.tcp + akka.remote.artery.enabled = off # in 2.4 this is off by default, but in 2.5+ its on so we wouldn't # get the right set of serializers (and since the old wire protocol doesn't # contain serializer ids that will go unnoticed with unpleasant consequences) diff --git a/akka-remote/src/test/scala/akka/remote/serialization/SerializationTransportInformationSpec.scala b/akka-remote/src/test/scala/akka/remote/serialization/SerializationTransportInformationSpec.scala index 427a68b824..5d7711dea4 100644 --- a/akka-remote/src/test/scala/akka/remote/serialization/SerializationTransportInformationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/serialization/SerializationTransportInformationSpec.scala @@ -131,8 +131,9 @@ abstract class AbstractSerializationTransportInformationSpec(config: Config) class SerializationTransportInformationSpec extends AbstractSerializationTransportInformationSpec(ConfigFactory.parseString(""" - akka.remote.netty.tcp { + akka.remote.artery.enabled = off + akka.remote.classic.netty.tcp { hostname = localhost port = 0 - } + } """)) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index d26210e846..4d012e3b4c 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -138,7 +138,7 @@ object AkkaBuild { |import scala.concurrent.duration._ |import akka.util.Timeout |var config = ConfigFactory.parseString("akka.stdout-loglevel=INFO,akka.loglevel=DEBUG,pinned{type=PinnedDispatcher,executor=thread-pool-executor,throughput=1000}") - |var remoteConfig = ConfigFactory.parseString("akka.remote.netty{port=0,use-dispatcher-for-io=akka.actor.default-dispatcher,execution-pool-size=0},akka.actor.provider=remote").withFallback(config) + |var remoteConfig = ConfigFactory.parseString("akka.remote.classic.netty{port=0,use-dispatcher-for-io=akka.actor.default-dispatcher,execution-pool-size=0},akka.actor.provider=remote").withFallback(config) |var system: ActorSystem = null |implicit def _system = system |def startSystem(remoting: Boolean = false) { system = ActorSystem("repl", if(remoting) remoteConfig else config); println("don’t forget to system.terminate()!") }