Clean properly populationStatus when an exception is thrown
Change-Id: Ibcb54e6cfe5031ef2854e96d9933bb522241e998
(cherry picked from commit 604e231a431aa39648a57e4cc705287c18ff97cc)
(cherry picked from commit 0283caef95fef60afcb076d285d8d38a37aec49e)
(cherry picked from commit 11d90d0a6748787f817dfdcc5e71225c88334b91)
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index 7dfa632..149e837 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -281,6 +281,10 @@
log.info("Completed all routing rule population. Total # of rules pushed : {}",
rulePopulator.getCounter());
return;
+ } catch (Exception e) {
+ log.error("populateAllRoutingRules thrown an exception: {}",
+ e.getMessage(), e);
+ populationStatus = Status.ABORTED;
} finally {
statusLock.unlock();
}
@@ -413,6 +417,10 @@
rulePopulator.getCounter());
return;
+ } catch (Exception e) {
+ log.error("populateSubnet thrown an exception: {}",
+ e.getMessage(), e);
+ populationStatus = Status.ABORTED;
} finally {
statusLock.unlock();
}
@@ -541,6 +549,10 @@
log.warn("Failed to repopulate the rules for link status change.");
return;
}
+ } catch (Exception e) {
+ log.error("populateRoutingRulesForLinkStatusChange thrown an exception: {}",
+ e.getMessage(), e);
+ populationStatus = Status.ABORTED;
} finally {
statusLock.unlock();
}