Merge "All openflow nodes are not getting listed in the output of getallnodes in...
authorArunprakash D <d.arunprakash@ericsson.com>
Mon, 1 Jun 2020 04:37:54 +0000 (04:37 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 1 Jun 2020 04:37:54 +0000 (04:37 +0000)
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowNodeReconciliationImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImpl.java

index 9859e9cce40b263e68e66c978f67a074652b60f8..86e3c8a1fed7d966bd3bf3addfde7ea6af5a3d93 100644 (file)
@@ -305,7 +305,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
                     }
                 } catch (InterruptedException | ExecutionException e) {
                     reconciliationState.setState(FAILED, LocalDateTime.now());
-                    LOG.error("commit bundle failed for device {} with error ", dpnId, e);
+                    LOG.error("Error while doing bundle based reconciliation for device ID:{}", dpnId, e);
                     return false;
                 } finally {
                     service.shutdown();
index 073a12df16c433b1ae61db8987054f351bb37c54..8a61ca1a5c954871e3fa388568ff56e0fbe2281d 100644 (file)
@@ -126,6 +126,7 @@ public class OpenFlowPluginProviderImpl implements
     private ListeningExecutorService executorService;
     private ContextChainHolderImpl contextChainHolder;
     private final OpenflowDiagStatusProvider openflowDiagStatusProvider;
+    private final SystemReadyMonitor systemReadyMonitor;
     private final SettableFuture<Void> fullyStarted = SettableFuture.create();
     private static final String OPENFLOW_SERVICE_NAME = "OPENFLOW";
 
@@ -156,8 +157,7 @@ public class OpenFlowPluginProviderImpl implements
         config = new OpenFlowProviderConfigImpl(configurationService);
         this.mastershipChangeServiceManager = mastershipChangeServiceManager;
         this.openflowDiagStatusProvider = openflowDiagStatusProvider;
-        systemReadyMonitor.registerListener(this);
-        LOG.info("registered onSystemBootReady() listener for deferred startSwitchConnections()");
+        this.systemReadyMonitor = systemReadyMonitor;
     }
 
     @Override
@@ -289,6 +289,8 @@ public class OpenFlowPluginProviderImpl implements
 
         deviceManager.setContextChainHolder(contextChainHolder);
         deviceManager.initialize();
+        systemReadyMonitor.registerListener(this);
+        LOG.info("registered onSystemBootReady() listener for deferred startSwitchConnections()");
     }
 
     @Override
index 2e6e5bb625a2ce0d782626197b29b28929f45379..e2f9e2b881134743d4bf63b2a4f9800300600199 100644 (file)
@@ -56,6 +56,7 @@ import org.slf4j.LoggerFactory;
 public class ConnectionManagerImpl implements ConnectionManager {
 
     private static final Logger LOG = LoggerFactory.getLogger(ConnectionManagerImpl.class);
+    private static final Logger OF_EVENT_LOG = LoggerFactory.getLogger("OfEventLog");
     private static final boolean BITMAP_NEGOTIATION_ENABLED = true;
     private final ThreadFactory threadFactory = new ThreadFactoryBuilder()
             .setNameFormat("ConnectionHandler-%d")
@@ -90,6 +91,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
     @Override
     public void onSwitchConnected(final ConnectionAdapter connectionAdapter) {
         connectionAdapter.setExecutorService(executorsService);
+        OF_EVENT_LOG.debug("OnSwitchConnected event received for device {}", connectionAdapter.getRemoteAddress());
         LOG.trace("prepare connection context");
         final ConnectionContext connectionContext = new ConnectionContextImpl(connectionAdapter,
                 deviceConnectionStatusProvider);
index 45f99f65f4836fa5d43da7f702095b0a2c1811fd..ab75ce3b82106dc81d74d33dbf25526997f14007 100644 (file)
@@ -212,7 +212,6 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
         if (LOG.isDebugEnabled()) {
             LOG.debug("Device context removed for node {}", deviceInfo);
         }
-
         this.updatePacketInRateLimiters();
     }
 
index f9f4eaac9899bebf82a03b7333a89a0b3850fea1..3b75ff9dab372295909d00fbbb48d3e2b3e1d397 100644 (file)
@@ -127,7 +127,6 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
     @VisibleForTesting
     void createContextChain(final ConnectionContext connectionContext) {
         final DeviceInfo deviceInfo = connectionContext.getDeviceInfo();
-
         final DeviceContext deviceContext = deviceManager.createContext(connectionContext);
         deviceContext.registerMastershipWatcher(this);
         LOG.debug("Device" + CONTEXT_CREATED_FOR_CONNECTION, deviceInfo);
@@ -216,8 +215,9 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
     }
 
     @Override
-    public void onNotAbleToStartMastership(final DeviceInfo deviceInfo, final String reason, final boolean mandatory) {
-        LOG.warn("Not able to set MASTER role on device {}, reason: {}", deviceInfo, reason);
+    public void onNotAbleToStartMastership(@NonNull final DeviceInfo deviceInfo, @NonNull final String reason,
+                                           final boolean mandatory) {
+        LOG.error("Not able to set MASTER role on device {}, reason: {}", deviceInfo, reason);
 
         if (!mandatory) {
             return;
@@ -255,7 +255,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
 
     @Override
     public void onSlaveRoleNotAcquired(final DeviceInfo deviceInfo, final String reason) {
-        LOG.warn("Not able to set SLAVE role on device {}, reason: {}", deviceInfo, reason);
+        LOG.error("Not able to set SLAVE role on device {}, reason: {}", deviceInfo, reason);
         Optional.ofNullable(contextChainMap.get(deviceInfo)).ifPresent(contextChain -> destroyContextChain(deviceInfo));
     }
 
@@ -289,6 +289,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
         copyOfChains.keySet().forEach(this::destroyContextChain);
         copyOfChains.clear();
         contextChainMap.clear();
+        OF_EVENT_LOG.debug("EOS registration closed for all devices");
         eosListenerRegistration.close();
         OF_EVENT_LOG.debug("EOS registration closed for all devices");
         nodeCleanerExecutor.shutdownNow();
@@ -405,7 +406,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
                     contextChain.continueInitializationAfterReconciliation();
                 } else {
                     OF_EVENT_LOG.debug("Reconciliation framework failure for device {}", deviceInfo);
-                    LOG.warn("Reconciliation framework failure for device {} with result {}", deviceInfo, result);
+                    LOG.warn("Reconciliation framework failure for device {} with resultState {}", deviceInfo, result);
                     destroyContextChain(deviceInfo);
                 }
             }
@@ -414,7 +415,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
             public void onFailure(final Throwable throwable) {
                 OF_EVENT_LOG.debug("Reconciliation framework failure for device {} with error {}", deviceInfo,
                         throwable.getMessage());
-                LOG.warn("Reconciliation framework failure.", throwable);
+                LOG.warn("Reconciliation framework failure for device {}", deviceInfo, throwable);
                 destroyContextChain(deviceInfo);
             }
         };
index b5c691047ba098df6bc7b22c14c035854c70ac74..21d8c32a33a5ef947718185d6c51d33d1c2bb8c6 100644 (file)
@@ -75,7 +75,7 @@ public class ContextChainImpl implements ContextChain {
             contexts.forEach(OFPContext::instantiateServiceInstance);
             LOG.info("Started clustering services for node {}", deviceInfo);
         } catch (final Exception ex) {
-            LOG.warn("Not able to start clustering services for node {}", deviceInfo);
+            LOG.error("Not able to start clustering services for node {}", deviceInfo);
             executorService.execute(() -> contextChainMastershipWatcher
                     .onNotAbleToStartMastershipMandatory(deviceInfo, ex.toString()));
         }