Thomas Vachuska
Committed by Gerrit Code Review

Eliminated the hang when shutting down a single-instance. Root cause remains in …

…the leadership topic withdrawal.

Change-Id: Iad740929b683a253a7eec0282b52e8f6f31ebcfe
...@@ -191,11 +191,14 @@ public class DistributedLeadershipManager implements LeadershipService { ...@@ -191,11 +191,14 @@ public class DistributedLeadershipManager implements LeadershipService {
191 191
192 @Deactivate 192 @Deactivate
193 public void deactivate() { 193 public void deactivate() {
194 + if (clusterService.getNodes().size() > 1) {
195 + // FIXME: Determine why this takes ~50 seconds to shutdown on a single node!
194 leaderBoard.forEach((topic, leadership) -> { 196 leaderBoard.forEach((topic, leadership) -> {
195 if (localNodeId.equals(leadership.leader())) { 197 if (localNodeId.equals(leadership.leader())) {
196 withdraw(topic); 198 withdraw(topic);
197 } 199 }
198 }); 200 });
201 + }
199 202
200 clusterService.removeListener(clusterEventListener); 203 clusterService.removeListener(clusterEventListener);
201 eventDispatcher.removeSink(LeadershipEvent.class); 204 eventDispatcher.removeSink(LeadershipEvent.class);
......