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 - leaderBoard.forEach((topic, leadership) -> { 194 + if (clusterService.getNodes().size() > 1) {
195 - if (localNodeId.equals(leadership.leader())) { 195 + // FIXME: Determine why this takes ~50 seconds to shutdown on a single node!
196 - withdraw(topic); 196 + leaderBoard.forEach((topic, leadership) -> {
197 - } 197 + if (localNodeId.equals(leadership.leader())) {
198 - }); 198 + withdraw(topic);
199 + }
200 + });
201 + }
199 202
200 clusterService.removeListener(clusterEventListener); 203 clusterService.removeListener(clusterEventListener);
201 eventDispatcher.removeSink(LeadershipEvent.class); 204 eventDispatcher.removeSink(LeadershipEvent.class);
......