FRM to properly handle timed flows in case of switch down/up 77/3777/1
authorAlessandro Boch <aboch@cisco.com>
Tue, 17 Dec 2013 00:29:22 +0000 (16:29 -0800)
committerAlessandro Boch <aboch@cisco.com>
Tue, 17 Dec 2013 01:01:30 +0000 (17:01 -0800)
- When node reconnects to controller, plugin will send remove all flow message.
  FRM will receive flow removed message and should toggle the installInHw flag
  only for the timed static flows, not all of them. At the end a timed flow with
  original configured timeout (idle or hard) is no longer valid later on.
- Fix bug in flow ui

Change-Id: I1474351fa750029246b89d11bdefb41e9bd6eefd
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/web/flows/src/main/resources/js/page.js

index 45fb11a..3d6a029 100644 (file)
@@ -2930,8 +2930,16 @@ public class ForwardingRulesManager implements
         }
         if (target != null) {
             // Update Configuration database
-            target.toggleInstallation();
-            target.setStatus(StatusCode.SUCCESS.toString());
+            if (target.getHardTimeout() != null || target.getIdleTimeout() != null) {
+                /*
+                 * No need for checking if actual values: these strings were
+                 * validated at configuration creation. Also, after a switch
+                 * down scenario, no use to reinstall a timed flow. Mark it as
+                 * "do not install". User can manually toggle it.
+                 */
+                target.toggleInstallation();
+            }
+            target.setStatus(StatusCode.GONE.toString());
             staticFlows.put(key, target);
         }
 
index 094562f..6b4cfa0 100644 (file)
@@ -390,8 +390,8 @@ one.f.flows = {
                     $tr = $(tr);
                     $span = $("td span", $tr);
                     var flowstatus = $span.data("flowstatus");
-                    if($span.data("installinhw") != null) {
-                        var installInHw = $span.data("installinhw").toString();
+                    if($span.data("installInHw") != null) {
+                        var installInHw = $span.data("installInHw").toString();
                         if(installInHw == "true" && flowstatus == "Success") {
                             $tr.addClass("success");
                         } else {