telemetry: keep known peers when a discovery refresh fails - #4146
Merged
elitegreg merged 1 commit intoAug 3, 2026
Merged
Conversation
elitegreg
marked this pull request as ready for review
August 3, 2026 16:01
elitegreg
enabled auto-merge (squash)
August 3, 2026 16:01
elitegreg
force-pushed
the
gm/telemetry-peer-cache-refresh
branch
from
August 3, 2026 16:56
6576103 to
c8a911b
Compare
elitegreg
changed the base branch from
main
to
gm/telemetry-pinger-epoch-fallback
August 3, 2026 16:56
elitegreg
merged commit Aug 3, 2026
cacceb9
into
gm/telemetry-pinger-epoch-fallback
42 of 47 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #4128
Independent of #4144 and #4145 (different file), so this one branches from
main.Summary of Changes
ledgerPeerDiscovery.refreshno longer empties the peer cache before doing work that can fail. It clearedp.peersunder the lock and then calledLocalNet.Interfaces(), so a transient failure there returned with zero peers andPinger.Tickiterated an empty slice, probing nothing until a later refresh succeeded.Diff Breakdown
A one-line behavioral fix plus the regression test that pins it.
Key files (click to expand)
controlplane/telemetry/internal/telemetry/peers.go— drops thep.peers = make(...)clear, moves the mutex to wrap onlyp.peers = peers, and leaves a comment that nothing in the build may clear the cacheTesting Verification
LocalNet.Interfaces()call, and assertsGetPeers()still returns the fully populated peer (link, device, tunnel, TWAMP port) after at least three failed refreshes. It fails against the pre-fix code, which returns an empty list.-race, since the change moves what the mutex covers.