Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Switch to Akka Artery
The migration away from legacy akka remoting to artery tcp.

JIRA: CONTROLLER-1968
Change-Id: Iac1a0186292eb5a303cf075e540f3f6c8c09a932
Signed-off-by: Kostiantyn Nosach <kostiantyn.nosach@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
  • Loading branch information
Kostiantyn Nosach authored and rovarga committed May 5, 2021
1 parent 3bad217 commit 229c55f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
Expand Up @@ -14,7 +14,7 @@
import akka.japi.Effect;
import akka.remote.AssociationErrorEvent;
import akka.remote.RemotingLifecycleEvent;
import akka.remote.ThisActorSystemQuarantinedEvent;
import akka.remote.artery.ThisActorSystemQuarantinedEvent;
import java.util.HashSet;
import java.util.Set;
import org.slf4j.Logger;
Expand Down
Expand Up @@ -18,7 +18,8 @@
import akka.japi.Effect;
import akka.remote.AssociationErrorEvent;
import akka.remote.InvalidAssociation;
import akka.remote.ThisActorSystemQuarantinedEvent;
import akka.remote.UniqueAddress;
import akka.remote.artery.ThisActorSystemQuarantinedEvent;
import akka.testkit.javadsl.TestKit;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -54,7 +55,9 @@ public void tearDown() {
public void testOnReceiveQuarantined() throws Exception {
final Throwable t = new RuntimeException("Remote has quarantined this system");
final InvalidAssociation cause = InvalidAssociation.apply(LOCAL, REMOTE, t, Option.apply(null));
final ThisActorSystemQuarantinedEvent event = new ThisActorSystemQuarantinedEvent(LOCAL, REMOTE);
final UniqueAddress localAddress = new UniqueAddress(LOCAL, 1);
final UniqueAddress remoteAddress = new UniqueAddress(REMOTE, 2);
final ThisActorSystemQuarantinedEvent event = new ThisActorSystemQuarantinedEvent(localAddress, remoteAddress);
actor.tell(event, ActorRef.noSender());
verify(callback, timeout(1000)).apply();
}
Expand Down
Expand Up @@ -3,14 +3,11 @@ odl-cluster-data {
akka {
remote {
artery {
enabled = off
enabled = on
transport = tcp
canonical.hostname = "127.0.0.1"
canonical.port = 2550
}
classic.netty.tcp {
hostname = "127.0.0.1"
port = 2550
}
# when under load we might trip a false positive on the failure detector
# transport-failure-detector {
# heartbeat-interval = 4 s
Expand All @@ -19,8 +16,8 @@ odl-cluster-data {
}

cluster {
# Remove ".tcp" when using artery.
seed-nodes = ["akka.tcp://opendaylight-cluster-data@127.0.0.1:2550"]
# Using artery.
seed-nodes = ["akka://opendaylight-cluster-data@127.0.0.1:2550"]

roles = [
"member-1"
Expand Down
Expand Up @@ -56,6 +56,11 @@ odl-cluster-data {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logger-startup-timeout = 300s

# JFR requires boot delegation, which we do not have by default
java-flight-recorder {
enabled = false
}

actor {
warn-about-java-serializer-usage = off
provider = "akka.cluster.ClusterActorRefProvider"
Expand Down Expand Up @@ -97,8 +102,11 @@ odl-cluster-data {
}

artery {
enabled = on
transport = tcp

advanced {
#maximum-frame-size = 256 KiB
maximum-frame-size = 400 MiB
#maximum-large-frame-size = 2 MiB
}
}
Expand Down
Expand Up @@ -87,7 +87,7 @@ public void testSetResolved() {

String peerId = ShardIdentifier.create("default", MEMBER_2, type).toString();

String address = "akka.tcp://opendaylight-cluster-data@127.0.0.1:2550/user/shardmanager-" + type
String address = "akka://opendaylight-cluster-data@127.0.0.1:2550/user/shardmanager-" + type
+ "/" + MEMBER_2.getName() + "-shard-default-" + type;

resolver.setResolved(peerId, address);
Expand Down

0 comments on commit 229c55f

Please sign in to comment.