mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-03 16:31:54 +01:00
tka: log a better error if there are no chain candidates
Previously if `chains` was empty, it would be passed to `computeActiveAncestor()`, which would fail with the misleading error "multiple distinct chains". Updates tailscale/corp#33846 Signed-off-by: Alex Chan <alexc@tailscale.com> Change-Id: Ib93a755dbdf4127f81cbf69f3eece5a388db31c8
This commit is contained in:
parent
c7dbd3987e
commit
4c67df42f6
@ -391,6 +391,10 @@ func computeActiveChain(storage Chonk, lastKnownOldest *AUMHash, maxIter int) (c
|
|||||||
return chain{}, fmt.Errorf("computing candidates: %v", err)
|
return chain{}, fmt.Errorf("computing candidates: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(chains) == 0 {
|
||||||
|
return chain{}, errors.New("no chain candidates in AUM storage")
|
||||||
|
}
|
||||||
|
|
||||||
// Find the right ancestor.
|
// Find the right ancestor.
|
||||||
oldestHash, err := computeActiveAncestor(chains)
|
oldestHash, err := computeActiveAncestor(chains)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user