Weaken assertion in PeerFinder
It can be inactive with no leader if it's handling an incoming PeersRequest before being activated for the first time.
This commit is contained in:
parent
3a5dab6d8e
commit
9cc416bc46
|
@ -161,7 +161,7 @@ public abstract class PeerFinder {
|
||||||
peersRequest.getKnownPeers().stream().map(DiscoveryNode::getAddress).forEach(this::startProbe);
|
peersRequest.getKnownPeers().stream().map(DiscoveryNode::getAddress).forEach(this::startProbe);
|
||||||
knownPeers = getFoundPeersUnderLock();
|
knownPeers = getFoundPeersUnderLock();
|
||||||
} else {
|
} else {
|
||||||
assert leader.isPresent();
|
assert leader.isPresent() || lastAcceptedNodes == null;
|
||||||
knownPeers = Collections.emptyList();
|
knownPeers = Collections.emptyList();
|
||||||
}
|
}
|
||||||
return new PeersResponse(leader, knownPeers, currentTerm);
|
return new PeersResponse(leader, knownPeers, currentTerm);
|
||||||
|
|
Loading…
Reference in New Issue