fix retransmission logic for path probing packets (#5241)

To achieve an exponential backoff, the timer should only be reset after
having fired.
This commit is contained in:
Marten Seemann
2025-06-26 13:49:44 +08:00
committed by GitHub
parent b94fc4d2d4
commit 1b9add1bec
2 changed files with 26 additions and 17 deletions

View File

@@ -50,6 +50,7 @@ func (p *Path) Probe(ctx context.Context) error {
p.validated.Store(true)
return nil
case <-timerChan:
nextProbeDur *= 2 // exponential backoff
p.pathManager.enqueueProbe(p)
case <-path.ProbeSent():
case <-p.abandon:
@@ -61,7 +62,6 @@ func (p *Path) Probe(ctx context.Context) error {
}
timer = time.NewTimer(nextProbeDur)
timerChan = timer.C
nextProbeDur *= 2 // exponential backoff
}
}