FRM should not remove a static flow config on async error report 39/4239/2
authorAlessandro Boch <aboch@cisco.com>
Tue, 14 Jan 2014 23:19:36 +0000 (15:19 -0800)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 15 Jan 2014 20:09:42 +0000 (20:09 +0000)
- Currently FRM is removing the affected static flow config on
  receiving a flow error event from the switch.
  The correct action is to modify the config status.
  The config removal was a temporary fix for the flow configuration across
  cluster (request served by another controller node) when this request was
  always sent asynchronously. Now it is no longer needed as FRM implements
  both the synch and async flow rewust across the cluster.

Change-Id: If2d473cd4688bdf83ecc0a0f5eb210b938157d29
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java

index 2b3347f..41075b9 100644 (file)
@@ -2994,7 +2994,11 @@ public class ForwardingRulesManager implements
                 // staticFlowEntry should never be null.
                 // the null check is just an extra defensive check.
                 if(staticFlowEntry != null) {
-                    staticFlows.remove(staticFlowEntry.getKey());
+                    // Modify status and update cluster cache
+                    log.debug("Updating static flow configuration on async error event");
+                    String status = String.format("Cannot be installed on node. reason: %s", errorString);
+                    staticFlowEntry.getValue().setStatus(status);
+                    refreshClusterStaticFlowsStatus(node);
                 }
             }
         }