From: Alessandro Boch Date: Tue, 17 Dec 2013 00:29:22 +0000 (-0800) Subject: FRM to properly handle timed flows in case of switch down/up X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~180^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=3c898339d638d4e2620e392834fcaf8f0552311f FRM to properly handle timed flows in case of switch down/up - 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 --- diff --git a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java index 45fb11a83e..3d6a0292ef 100644 --- a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java +++ b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java @@ -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); } diff --git a/opendaylight/web/flows/src/main/resources/js/page.js b/opendaylight/web/flows/src/main/resources/js/page.js index 094562fac0..6b4cfa0025 100644 --- a/opendaylight/web/flows/src/main/resources/js/page.js +++ b/opendaylight/web/flows/src/main/resources/js/page.js @@ -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 {