stress test related improvement 28/4628/2 jenkins-openflowplugin-bulk-release-prepare-only-4
authorMichal Rehak <mirehak@cisco.com>
Thu, 23 Jan 2014 08:20:48 +0000 (09:20 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 23 Jan 2014 16:33:41 +0000 (16:33 +0000)
- propagate close upon bundle stop
- enriched logging upon echo timeout disconnect
- increased echo timeout from 5 to 15 sec
- fix memory leak in OpenflowpluginTestCommandProvider.FlowEventListener

Change-Id: I13c9bd319438f883271bd3ddc71e5952f45a351f
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/Activator.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/ConnectionConductorImpl.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/ConnectionConfigurationFactory.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OpenflowPluginProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestCommandProvider.java

index 24e7630e3defa852c70c05de5bf66df17184bd3e..fd162e64519757be54274002e43608695ccac257 100644 (file)
@@ -40,6 +40,8 @@ public class Activator extends ComponentActivatorAbstractBase {
      *
      */
     public void destroy() {
+        pluginProvider.close();
+        super.destroy();
     }
 
     @Override
index 95f1b2727277d3f04d6a37421fe2dea70dd27ab9..b65cec3a543444a303a6128d53feaeda377898b3 100644 (file)
@@ -75,9 +75,9 @@ public class ConnectionConductorImpl implements OpenflowProtocolListener,
     private ConnectionConductor.CONDUCTOR_STATE conductorState;
     private Short version;
 
-    private SwitchConnectionDistinguisher auxiliaryKey;
+    protected SwitchConnectionDistinguisher auxiliaryKey;
 
-    private SessionContext sessionContext;
+    protected SessionContext sessionContext;
 
     private QueueKeeper<OfHeader, DataObject> queueKeeper;
     private ExecutorService hsPool;
@@ -248,7 +248,7 @@ public class ConnectionConductorImpl implements OpenflowProtocolListener,
                     disconnect();
                     OFSessionUtil.getSessionManager().invalidateOnDisconnect(ConnectionConductorImpl.this);
                 } else {
-                    LOG.debug("first idle state occured");
+                    LOG.debug("first idle state occured, sessionCtx={}|auxId={}", sessionContext, auxiliaryKey);
                     EchoInputBuilder builder = new EchoInputBuilder();
                     builder.setVersion(getVersion());
                     builder.setXid(getSessionContext().getNextXid());
@@ -322,7 +322,7 @@ public class ConnectionConductorImpl implements OpenflowProtocolListener,
 
     @Override
     public Future<Boolean> disconnect() {
-        LOG.info("disconnecting: sessionCtx="+sessionContext+"|auxId="+auxiliaryKey);
+        LOG.info("disconnecting: sessionCtx={}|auxId={}", sessionContext, auxiliaryKey);
 
         Future<Boolean> result = null;
         if (connectionAdapter.isAlive()) {
index b2f8d312b390a742a21504ac743bd39f8af56ecd..12341d757332659ee99e7c61af6bae691462c965 100644 (file)
@@ -52,7 +52,7 @@ public abstract class ConnectionConfigurationFactory {
 
             @Override
             public long getSwitchIdleTimeout() {
-                return 5000;
+                return 15000;
             }
 
             @Override
@@ -92,7 +92,7 @@ public abstract class ConnectionConfigurationFactory {
 
             @Override
             public long getSwitchIdleTimeout() {
-                return 5000;
+                return 15000;
             }
 
             @Override
index 2737326a3b8af2fd1159b71c96f1f2d1487573d2..a7a3ca13dde9ad83a5eccb2d98b40f605dc38608 100644 (file)
@@ -27,7 +27,7 @@ import org.osgi.framework.BundleContext;
 /**
  * OFPlugin provider implementation
  */
-public class OpenflowPluginProvider implements BindingAwareProvider {
+public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseable {
 
     private BindingAwareBroker broker;
 
@@ -74,6 +74,11 @@ public class OpenflowPluginProvider implements BindingAwareProvider {
         messageCountCommandProvider = new MessageCountCommandProvider(context, messageCountProvider);
         messageCountCommandProvider.onSessionInitiated(session);
     }
+    
+    @Override
+    public void close() {
+        mdController.stop();
+    }
 
     @Override
     public void onSessionInitialized(ConsumerContext session) {
index fd06be13efd82f58156df01d42a083984074507b..cc99c263b78d90901d1b4c4061f8e9c4581d0d9c 100644 (file)
@@ -223,16 +223,11 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     final class FlowEventListener implements SalFlowListener {
 
-        List<FlowAdded> addedFlows = new ArrayList<>();
-        List<FlowRemoved> removedFlows = new ArrayList<>();
-        List<FlowUpdated> updatedFlows = new ArrayList<>();
-
         @Override
         public void onFlowAdded(FlowAdded notification) {
             LOG.info("flow to be added.........................." + notification.toString());
             LOG.info("added flow Xid........................." + notification.getTransactionId().getValue());
             LOG.info("-----------------------------------------------------------------------------------");
-            addedFlows.add(notification);
         }
 
         @Override
@@ -240,15 +235,13 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
             LOG.debug("removed flow.........................." + notification.toString());
             LOG.debug("remove flow Xid........................." + notification.getTransactionId().getValue());
             LOG.debug("-----------------------------------------------------------------------------------");
-            removedFlows.add(notification);
-        };
+        }
 
         @Override
         public void onFlowUpdated(FlowUpdated notification) {
             LOG.debug("updated flow.........................." + notification.toString());
             LOG.debug("updated flow Xid........................." + notification.getTransactionId().getValue());
             LOG.debug("-----------------------------------------------------------------------------------");
-            updatedFlows.add(notification);
         }
 
         @Override