Fix OpsManager registry instantiation 33/90233/3
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 3 Jun 2020 13:51:54 +0000 (15:51 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 3 Jun 2020 13:56:06 +0000 (15:56 +0200)
We have a day-zero bug with actions, as OpsManager ends up
instantiating the wrong actor -- hence we have two RpcRegistry
instances and no ActionRegistry instances.

JIRA: CONTROLLER-1943
Change-Id: I3b374454af3225cf13d5e23e4fb6744bf3f9ed99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/OpsManager.java

index ea08565..40e9268 100644 (file)
@@ -16,6 +16,7 @@ import akka.actor.Props;
 import akka.actor.SupervisorStrategy;
 import java.util.concurrent.TimeUnit;
 import org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor;
+import org.opendaylight.controller.remote.rpc.registry.ActionRegistry;
 import org.opendaylight.controller.remote.rpc.registry.RpcRegistry;
 import org.opendaylight.mdsal.dom.api.DOMActionProviderService;
 import org.opendaylight.mdsal.dom.api.DOMActionService;
@@ -32,8 +33,8 @@ public class OpsManager extends AbstractUntypedActor {
     private final DOMRpcProviderService rpcProvisionRegistry;
     private final RemoteOpsProviderConfig config;
     private final DOMRpcService rpcServices;
-    private DOMActionProviderService actionProvisionRegistry;
-    private DOMActionService actionService;
+    private final DOMActionProviderService actionProvisionRegistry;
+    private final DOMActionService actionService;
 
     private ListenerRegistration<OpsListener> listenerReg;
     private ActorRef opsInvoker;
@@ -80,9 +81,9 @@ public class OpsManager extends AbstractUntypedActor {
                 .withMailbox(config.getMailBoxName()), config.getRpcRegistryName());
         LOG.debug("Propagating RPC information with {}", rpcRegistry);
 
-        actionRegistry = getContext().actorOf(RpcRegistry.props(config, opsInvoker, opsRegistrar)
+        actionRegistry = getContext().actorOf(ActionRegistry.props(config, opsInvoker, opsRegistrar)
                 .withMailbox(config.getMailBoxName()), config.getActionRegistryName());
-        LOG.debug("Propagating RPC information with {}", actionRegistry);
+        LOG.debug("Propagating action information with {}", actionRegistry);
 
         final OpsListener opsListener = new OpsListener(rpcRegistry, actionRegistry);
         LOG.debug("Registering local availability listener {}", opsListener);

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.