Committed by
Gerrit Code Review
Protect the RouteManagers threads from exceptions thrown by listeners
Change-Id: Ia260dcdcb83070939b96e4c7fb8d20baa0ae78a5
Showing
1 changed file
with
7 additions
and
4 deletions
... | @@ -279,12 +279,15 @@ public class RouteManager implements ListenerService<RouteEvent, RouteListener>, | ... | @@ -279,12 +279,15 @@ public class RouteManager implements ListenerService<RouteEvent, RouteListener>, |
279 | } | 279 | } |
280 | 280 | ||
281 | private void poll() { | 281 | private void poll() { |
282 | - try { | 282 | + while (true) { |
283 | - while (true) { | 283 | + try { |
284 | listener.event(queue.take()); | 284 | listener.event(queue.take()); |
285 | + } catch (InterruptedException e) { | ||
286 | + log.info("Route listener event thread shutting down: {}", e.getMessage()); | ||
287 | + break; | ||
288 | + } catch (Exception e) { | ||
289 | + log.warn("Exception during route event handler", e); | ||
285 | } | 290 | } |
286 | - } catch (InterruptedException e) { | ||
287 | - log.info("Route listener event thread shutting down: {}", e.getMessage()); | ||
288 | } | 291 | } |
289 | } | 292 | } |
290 | 293 | ... | ... |
-
Please register or login to post a comment