- FRM when shutting down should only clean local entries and avoid to
trigger remote deletion because that cleanup will also be initiated on
the remote controller
- On shutdown make sure to wake up who may still be sleeping
Change-Id: I15346f73a761c71014c02762e44ccdae8e95edef
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
+ if (this.waitingLatch.getCount() != 0L) {
+ this.retStatus = new Status(StatusCode.GONE);
+ this.waitingLatch.countDown();
+ logger.trace("Cancelled the workOrder");
+ return true;
+ }
* If requested, a copy of each original flow entry will be stored in the
* inactive list so that it can be re-applied when needed (This is typically
* the case when running in the default container and controller moved to
* If requested, a copy of each original flow entry will be stored in the
* inactive list so that it can be re-applied when needed (This is typically
* the case when running in the default container and controller moved to
+ * container mode) NOTE WELL: The routine as long as does a bulk change will
+ * operate only on the entries for nodes locally attached so to avoid
+ * redundant operations initiated by multiple nodes
*
* @param preserveFlowEntries
* if true, a copy of each original entry is stored in the
*
* @param preserveFlowEntries
* if true, a copy of each original entry is stored in the
// Now remove the entries
for (FlowEntryInstall flowEntryHw : toRemove) {
// Now remove the entries
for (FlowEntryInstall flowEntryHw : toRemove) {
- Status status = this.removeEntryInternal(flowEntryHw, false);
- if (!status.isSuccess()) {
- log.warn("Failed to remove entry: {}. The failure is: {}", flowEntryHw, status.getDescription());
+ Node n = flowEntryHw.getNode();
+ if (n != null && connectionManager.getLocalityStatus(n) == ConnectionLocality.LOCAL) {
+ Status status = this.removeEntryInternal(flowEntryHw, false);
+ if (!status.isSuccess()) {
+ log.warn("Failed to remove entry: {}. The failure is: {}", flowEntryHw, status.getDescription());
+ }
+ } else {
+ log.debug("Not removing entry {} because not connected locally, the remote guy will do it's job",
+ flowEntryHw);
uninstallAllFlowEntries(false);
// Shutdown executor
this.executor.shutdownNow();
uninstallAllFlowEntries(false);
// Shutdown executor
this.executor.shutdownNow();
+ // Now walk all the workMonitor and wake up the one sleeping because
+ // destruction is happening
+ for (FlowEntryDistributionOrder fe : workMonitor.keySet()) {
+ FlowEntryDistributionOrderFutureTask task = workMonitor.get(fe);
+ task.cancel(true);
+ }
}
public void setFlowProgrammerService(IFlowProgrammerService service) {
}
public void setFlowProgrammerService(IFlowProgrammerService service) {