Bug 1972 - Flows failed to get programmed in a very random fashion. 53/11353/1
authorMadhu Venugopal <mavenugo@gmail.com>
Fri, 19 Sep 2014 05:50:27 +0000 (22:50 -0700)
committerMadhu Venugopal <mavenugo@gmail.com>
Fri, 19 Sep 2014 05:50:27 +0000 (22:50 -0700)
Fixing it by introducing a little bit of a delay in writeFlow. This solves the pipeline flow programming woes.
Also eventdispatcher quits if there is atleast 1 exception. This can result in event queue backing up completely.

Change-Id: Ifc8a5d16e4ae332281b6f2ea8e99788dc8c42a49
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/AbstractServiceInstance.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/EventDispatcherImpl.java

index 488039ca16e28fbde868705b7f9f9da80bef7110..609ae88c994342e9636c0aed2038ffe4dadf0397 100644 (file)
@@ -134,6 +134,7 @@ public abstract class AbstractServiceInstance {
         try {
             commitFuture.get();  // TODO: Make it async (See bug 1362)
             logger.debug("Transaction success for write of Flow "+flowBuilder.getFlowName());
+            Thread.sleep(500);
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
             modification.cancel();
index 6f45bdead6f8bb7b238cf2c007cefaa9adb92c3e..8ef0d2c0155ecb021e4fd1c6377ea5a6e2b8b3b6 100644 (file)
@@ -51,7 +51,11 @@ public class EventDispatcherImpl implements EventDispatcher {
                         logger.info("The event handler thread was interrupted, shutting down", e);
                         return;
                     }
-                    dispatchEvent(ev);
+                    try {
+                        dispatchEvent(ev);
+                    } catch (Exception e) {
+                        logger.error("Exception in dispatching event "+ev.toString(), e);
+                    }
                 }
             }
         });