Files
livekit/pkg
Leo Camus 1e539510c0 ccutils: use millisecond resolution for probe interval backoff (#4891)
* ccutils: use millisecond resolution for probe interval backoff

ProbeSignal grew probeInterval via Seconds(), which truncates the float
to the nearest nanosecond before scaling by time.Second:

    time.Duration(probeInterval.Seconds() * BackoffFactor) * time.Second

With BackoffFactor=1.5 and the default BaseInterval of 3 s, the first
congestion signal produced 4 s instead of 4.5 s, and the error compounded
on every subsequent signal (4 s → 6 s → 9 s → 13 s ... instead of
4.5 s → 6.75 s → 10.125 s ...).  The interval converges to MaxInterval
later than intended, so the server probes more frequently during sustained
congestion than the configuration requests.

probeDuration in the same function already uses the correct idiom:

    time.Duration(float64(probeDuration.Milliseconds()) * Factor) * time.Millisecond

Apply the same pattern to probeInterval so both fields are computed
consistently with millisecond precision.

Found by a defect-hunting pipeline I build and run ([Dev-next-gen](https://github.com/Dev-next-gen)), using Claude Code with Anthropic's Claude Opus 5.

* ccutils: remove probe interval backoff test

Requested by reviewer.
2026-09-22 11:04:53 +05:30
..
2025-11-28 21:51:53 +05:30
2026-09-21 15:40:21 -07:00