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>
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();
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);
+ }
}
}
});