commit | 379647649f46a461096ed53985acd1c8698992ef | [log] [tgz] |
---|---|---|
author | Tian Jian <tian.jian@zte.com.cn> | Fri Jul 28 16:06:16 2017 +0800 |
committer | Thomas Vachuska <tom@opennetworking.org> | Mon Aug 14 17:56:36 2017 +0000 |
tree | 28b108b5a9086b9eb85099015e79bbed3e18be58 | |
parent | 0b4222e4b071455a8b7845d0f6b41d7cc4fec580 [diff] |
ONOS-6864 Fix a DispatchLoop restart bug. Change-Id: I7d789400daa51aad805565f65e9f2aa37a5cb9b3
diff --git a/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java b/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java index f395736..cbcf1b4 100644 --- a/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java +++ b/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java
@@ -215,6 +215,11 @@ add(KILL_PILL); } + void restart() { + dispatchFuture.cancel(true); + dispatchFuture = executor.submit(this); + } + // Monitors event sinks to make sure none take too long to execute. private class Watchdog extends TimerTask { @Override @@ -231,9 +236,8 @@ // Cancel the old dispatch loop and submit a new one. - stop(); - dispatchFuture.cancel(true); - dispatchFuture = executor.submit(this); + stop(); + restart(); } } }