Description
In ZooKeeperLeaderElectionService:
@Override public boolean hasLeadership() { if(leaderLatch.getState().equals(LeaderLatch.State.STARTED)) { return leaderLatch.hasLeadership(); } else { return false; } }
Looking into the leader leaderLatch.hasLeadership(), the state gets checked already/again.
return (state.get() == State.STARTED) && hasLeadership.get();