Big fix: Move the "try ... catch" block inside the "while (true)" block
when processing topology events. Thus, catching an exception
will not stop the processing of future events.
Bug found by: Jono
Change-Id: I696cb702b6eb1f47266a873905df22fb5e5400cb
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyManager.java b/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
index 343102b..78b6b9f 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
@@ -167,17 +167,19 @@
//
// The main loop
//
- try {
- while (true) {
- EventEntry<TopologyEvent> eventEntry = topologyEvents.take();
+ while (true) {
+ try {
+ EventEntry<TopologyEvent> eventEntry =
+ topologyEvents.take();
collection.add(eventEntry);
topologyEvents.drainTo(collection);
processEvents(collection);
collection.clear();
+ } catch (Exception exception) {
+ log.debug("Exception processing Topology Events: ",
+ exception);
}
- } catch (Exception exception) {
- log.debug("Exception processing Topology Events: ", exception);
}
}