Repository navigation
config: reject unknown send_side_bwe_pacer, warn on unwired fallback - #4804
Conversation
send_side_bwe_pacer accepted any string and silently ran no-queue. leaky-bucket is a defined PacerBehavior with a full LeakyBucket implementation, but the selection switch in NewPCTransport only handled pass-through and no-queue, so both leaky-bucket and outright typos fell through to the default with no diagnostic. leaky-bucket is deliberately left unwired here. LeakyBucket paces to a bitrate supplied via Pacer.SetBitrate, and no production code calls SetBitrate or SetInterval -- Base no-ops both and the only caller in the tree is the test-only capturingPacer. Wiring it as-is would pace at a static bitrate and ignore the bandwidth estimate, which is worse than the fallback. Instead, make the existing behaviour visible: CongestionControlConfig.Validate rejects unrecognised values at startup, the fallback logs a warning naming the requested pacer, and config-sample.yaml documents send_side_bwe_pacer and use_send_side_bwe for the first time. Refs livekit#4724 Co-Authored-By: Claude Opus 5 <[email protected]>
|
@boks1971 gentle ping on this one. Following your note on #4724 that leaky-bucket is untested and not production ready, this PR deliberately does not enable it. It only makes the current fallback visible. I checked it on Rocky Linux 10, comparing the parent commit with this branch and connecting one participant per case:
One compatibility note: the only configs this breaks are ones with an unrecognised |
|
Thank you. LGTM! |
…7 ➔ v1.13.8) (#2275) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [docker.io/livekit/livekit-server](https://github.com/livekit/livekit) | patch | `v1.13.7` → `v1.13.8` | --- ### Release Notes <details> <summary>livekit/livekit (docker.io/livekit/livekit-server)</summary> ### [`v1.13.8`](https://github.com/livekit/livekit/releases/tag/v1.13.8) [Compare Source](livekit/livekit@v1.13.7...v1.13.8) ##### Added - agent: HTTP endpoints data plane ([#​4779](livekit/livekit#4779)) - use sender report pass through setting to forward abs-capture-time verbatim ([#​4812](livekit/livekit#4812)) - Add sdk lable to session start time and participant join ([#​4885](livekit/livekit#4885)) - Add a local participant method to get recently disconnected ([#​4911](livekit/livekit#4911)) - service: start room composite egress configured in a room preset ([#​4926](livekit/livekit#4926)) ##### Changed - Update github workflows ([#​4446](livekit/livekit#4446)) - Reduce descriptor marshal allocations on Go 1.26.4/linux-amd64 ([#​4681](livekit/livekit#4681)) - config: reject unknown send\_side\_bwe\_pacer, warn on unwired fallback ([#​4804](livekit/livekit#4804)) - Update github.com/livekit/protocol digest to [`a879e94`](livekit/livekit@a879e94) ([#​4864](livekit/livekit#4864)) - Update module github.com/gotesttools/gotestfmt/v2 to v2.5.0 ([#​4865](livekit/livekit#4865)) - Update module github.com/urfave/cli/v3 to v3.11.0 ([#​4867](livekit/livekit#4867)) - Update module golang.org/x/mod to v0.41.0 ([#​4868](livekit/livekit#4868)) - sfu: return VP8 munged header by value to avoid per-packet allocation ([#​4871](livekit/livekit#4871)) - sfu: patch pacer header extensions without per-packet allocation ([#​4872](livekit/livekit#4872)) - Update pion/sdp to get lesser SDP retention ([#​4873](livekit/livekit#4873)) - sfu: skip pacer allocation assertion under the race detector ([#​4874](livekit/livekit#4874)) - sfu: broadcast RTP to down tracks without per-packet allocations ([#​4875](livekit/livekit#4875)) - Track action versions and stop quarantining our own actions ([#​4877](livekit/livekit#4877)) - test: fix two data races in the test suites ([#​4878](livekit/livekit#4878)) - Bump go.opentelemetry.io/otel/sdk ([#​4879](livekit/livekit#4879)) - deps: update psrpc to v0.8.0 ([#​4882](livekit/livekit#4882)) - Update module github.com/moby/moby/client to v0.6.0 ([#​4883](livekit/livekit#4883)) - Update module golang.org/x/sync to v0.23.0 ([#​4884](livekit/livekit#4884)) - Propagate SIP\_TRUNK\_FAILURE ([#​4890](livekit/livekit#4890)) - ccutils: use millisecond resolution for probe interval backoff ([#​4891](livekit/livekit#4891)) - Increase receiver loadbalance threshold when batch io enabled ([#​4899](livekit/livekit#4899)) - rtc: parse each remote offer once per negotiation ([#​4904](livekit/livekit#4904)) - Bump protocol ([#​4909](livekit/livekit#4909)) - rtc: split EndSession out of MoveToRoom ([#​4917](livekit/livekit#4917)) - telemetry: drop the stats worker re-key path ([#​4918](livekit/livekit#4918)) - sfu: report forwarding latency as p90 instead of the mean ([#​4920](livekit/livekit#4920)) - rtc: accept ICE Completed in ICE-restart connect assertions ([#​4921](livekit/livekit#4921)) - rtc: measure data blob keys by their content, not their text form ([#​4923](livekit/livekit#4923)) - Remove deprecatred way of setting prometheus from the config file ([#​4928](livekit/livekit#4928)) - test: give mock participants a connection quality, close test rooms ([#​4933](livekit/livekit#4933)) - update warp dep ([#​4943](livekit/livekit#4943)) ##### Fixed - Do not add down tracks after receiver close ([#​4857](livekit/livekit#4857)) - Do not request media sections for transceivers that cannot send ([#​4892](livekit/livekit#4892)) - Deregister agent job when the server terminates it ([#​4893](livekit/livekit#4893)) - sfu: don't hold bindLock across the blank-frame flush in CloseWithFlush ([#​4895](livekit/livekit#4895)) - dynacast: re-send subscribed qualities after every publisher answer ([#​4907](livekit/livekit#4907)) - agent: release JobTerminate handler when job ends before registration ([#​4908](livekit/livekit#4908)) - Report disconnected for older disconnected participants. ([#​4910](livekit/livekit#4910)) - rtc: record a room's departure when the participant leaves it ([#​4913](livekit/livekit#4913)) - update deps to fix warp issue ([#​4916](livekit/livekit#4916)) - sfu: fix data stats active window bitrate and duration units ([#​4922](livekit/livekit#4922)) - fix: reject instead of drop for no dispatch rule ([#​4927](livekit/livekit#4927)) - fix: skip RTX/FEC when picking a fallback video codec ([#​4930](livekit/livekit#4930)) - fix: do not read invalid delta ([#​4935](livekit/livekit#4935)) - fix: use the fast debounce for the first negotiation ([#​4936](livekit/livekit#4936)) - fix: skip DTLS HelloVerifyRequest ([#​4937](livekit/livekit#4937)) - config: parse generated duration flags as durations ([#​4939](livekit/livekit#4939)) - fix: use the most common recent packet rate in connection quality ([#​4940](livekit/livekit#4940)) - fix: copy RED history packets instead of keeping pointers ([#​4941](livekit/livekit#4941)) - fix: keep one subscription when first subscribes race ([#​4944](livekit/livekit#4944)) - bump protocol to get unlock on no key fix ([#​4945](livekit/livekit#4945)) - fix: count leftover upstream loss after RTX repairs ([#​4946](livekit/livekit#4946)) - fix: switch VP8 temporal layer up only at a layer sync frame ([#​4947](livekit/livekit#4947)) - fix: reconcile everything when the reconcile queue overflows ([#​4948](livekit/livekit#4948)) - fix: enable H.264 publish for desktop Linux Firefox ([#​4949](livekit/livekit#4949)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjEzMy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/2275
The leaky-bucket value of send_side_bwe_pacer has been accepted by config validation since livekit#4804, but it fell back to no-queue at transport creation because nothing drove Pacer.SetBitrate. - build a LeakyBucket for leaky-bucket in newSendSidePacer - push the channel capacity the stream allocator is enforcing to Pacer.SetBitrate: congestion state changes, probe results, capacity overrides, and allocator state transitions. egress is not capped while the allocator is not constraining it, matching its free pass allocation, so healthy streams keep flowing at their natural rate - pace at the probe target while a probe cluster is active, pacing probes at the rate under test would hold the probe back - bound the pacer queue to 0.5s of media at the active pacing rate, dropping the stalest packets beyond it and returning them to their pools, so sustained input above the rate cannot grow latency without bound Tests cover the pacing rate, the probe target override, the queue bound, and the allocator driving the pacer, including the congestion-cleared and override-cleared cases. Fixes livekit#4724
The leaky-bucket value of send_side_bwe_pacer has been accepted by config validation since livekit#4804, but it fell back to no-queue at transport creation because nothing drove Pacer.SetBitrate. - build a LeakyBucket for leaky-bucket in newSendSidePacer - push the channel capacity the stream allocator is enforcing to Pacer.SetBitrate: congestion state changes, probe results, capacity overrides, and allocator state transitions. egress is not capped while the allocator is not constraining it, matching its free pass allocation, so healthy streams keep flowing at their natural rate - pace at the probe target while a probe cluster is active, pacing probes at the rate under test would hold the probe back - bound the pacer queue to 0.5s of media at the active pacing rate, dropping the stalest packets beyond it and returning them to their pools, so sustained input above the rate cannot grow latency without bound Tests cover the pacing rate, the probe target override, the queue bound, and the allocator driving the pacer, including the congestion-cleared and override-cleared cases. Fixes livekit#4724
The leaky-bucket value of send_side_bwe_pacer has been accepted by config validation since livekit#4804, but it fell back to no-queue at transport creation because nothing drove Pacer.SetBitrate. - build a LeakyBucket for leaky-bucket in newSendSidePacer - push the channel capacity the stream allocator is enforcing to Pacer.SetBitrate: congestion state changes, probe results, capacity overrides, and allocator state transitions. egress is not capped while the allocator is not constraining it, matching its free pass allocation, so healthy streams keep flowing at their natural rate - pace at the probe target while a probe cluster is active, pacing probes at the rate under test would hold the probe back - bound the pacer queue to 0.5s of media at the active pacing rate, dropping whole frames from the front so what remains stays decodable, never truncating the frame being assembled, and never dropping the newest packet so an oversized packet still gets through. dropped packets return to their pools Tests cover the pacing rate, the probe target override, the queue bound, frame-aware drops, the oversized-packet path, and the allocator driving the pacer, including the congestion-cleared and override-cleared cases. Fixes livekit#4724
The leaky-bucket value of send_side_bwe_pacer has been accepted by config validation since livekit#4804, but it fell back to no-queue at transport creation because nothing drove Pacer.SetBitrate. - build a LeakyBucket for leaky-bucket in newSendSidePacer - push the channel capacity the stream allocator is enforcing to Pacer.SetBitrate: congestion state changes, probe results, capacity overrides, and allocator state transitions. egress is not capped while the allocator is not constraining it, matching its free pass allocation, so healthy streams keep flowing at their natural rate - pace at the probe target while a probe cluster is active, pacing probes at the rate under test would hold the probe back - bound the pacer queue to 0.5s of media at the active pacing rate, dropping whole frames from the front so what remains stays decodable, never truncating the frame being assembled, and never dropping the newest packet so an oversized packet still gets through. dropped packets return to their pools Tests cover the pacing rate, the probe target override, the queue bound, frame-aware drops, the oversized-packet path, and the allocator driving the pacer, including the congestion-cleared and override-cleared cases. Fixes livekit#4724
…7 → v1.13.9) (#854) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [docker.io/livekit/livekit-server](https://github.com/livekit/livekit) | patch | `v1.13.7` → `v1.13.9` | --- ### Release Notes <details> <summary>livekit/livekit (docker.io/livekit/livekit-server)</summary> ### [`v1.13.9`](https://github.com/livekit/livekit/releases/tag/v1.13.9) [Compare Source](livekit/livekit@v1.13.8...v1.13.9) Please note that release v1.13.8 introduced a behaviour change that caused egress start failures explained in [#​4955](livekit/livekit#4955). This release restores the behaviour to what it was in v1.13.7 and before. ##### Changed - bump protocol and psrpc deps ([#​4958](livekit/livekit#4958)) - sfu/buffer: parse the dependency descriptor without allocating ([#​4953](livekit/livekit#4953)) - sfu/buffer: stop allocating per ingested packet ([#​4951](livekit/livekit#4951)) ##### Fixed - v1 path: check for subscriber_allow_pause presence before using it ([#​4957](livekit/livekit#4957)) - Cap forward-jump loops in SelectorDecisionCache ([#​4952](livekit/livekit#4952)) ### [`v1.13.8`](https://github.com/livekit/livekit/releases/tag/v1.13.8) [Compare Source](livekit/livekit@v1.13.7...v1.13.8) ##### Added - agent: HTTP endpoints data plane ([#​4779](livekit/livekit#4779)) - use sender report pass through setting to forward abs-capture-time verbatim ([#​4812](livekit/livekit#4812)) - Add sdk lable to session start time and participant join ([#​4885](livekit/livekit#4885)) - Add a local participant method to get recently disconnected ([#​4911](livekit/livekit#4911)) - service: start room composite egress configured in a room preset ([#​4926](livekit/livekit#4926)) ##### Changed - Update github workflows ([#​4446](livekit/livekit#4446)) - Reduce descriptor marshal allocations on Go 1.26.4/linux-amd64 ([#​4681](livekit/livekit#4681)) - config: reject unknown send_side_bwe_pacer, warn on unwired fallback ([#​4804](livekit/livekit#4804)) - Update github.com/livekit/protocol digest to [`a879e94`](livekit/livekit@a879e94) ([#​4864](livekit/livekit#4864)) - Update module github.com/gotesttools/gotestfmt/v2 to v2.5.0 ([#​4865](livekit/livekit#4865)) - Update module github.com/urfave/cli/v3 to v3.11.0 ([#​4867](livekit/livekit#4867)) - Update module golang.org/x/mod to v0.41.0 ([#​4868](livekit/livekit#4868)) - sfu: return VP8 munged header by value to avoid per-packet allocation ([#​4871](livekit/livekit#4871)) - sfu: patch pacer header extensions without per-packet allocation ([#​4872](livekit/livekit#4872)) - Update pion/sdp to get lesser SDP retention ([#​4873](livekit/livekit#4873)) - sfu: skip pacer allocation assertion under the race detector ([#​4874](livekit/livekit#4874)) - sfu: broadcast RTP to down tracks without per-packet allocations ([#​4875](livekit/livekit#4875)) - Track action versions and stop quarantining our own actions ([#​4877](livekit/livekit#4877)) - test: fix two data races in the test suites ([#​4878](livekit/livekit#4878)) - Bump go.opentelemetry.io/otel/sdk ([#​4879](livekit/livekit#4879)) - deps: update psrpc to v0.8.0 ([#​4882](livekit/livekit#4882)) - Update module github.com/moby/moby/client to v0.6.0 ([#​4883](livekit/livekit#4883)) - Update module golang.org/x/sync to v0.23.0 ([#​4884](livekit/livekit#4884)) - Propagate SIP_TRUNK_FAILURE ([#​4890](livekit/livekit#4890)) - ccutils: use millisecond resolution for probe interval backoff ([#​4891](livekit/livekit#4891)) - Increase receiver loadbalance threshold when batch io enabled ([#​4899](livekit/livekit#4899)) - rtc: parse each remote offer once per negotiation ([#​4904](livekit/livekit#4904)) - Bump protocol ([#​4909](livekit/livekit#4909)) - rtc: split EndSession out of MoveToRoom ([#​4917](livekit/livekit#4917)) - telemetry: drop the stats worker re-key path ([#​4918](livekit/livekit#4918)) - sfu: report forwarding latency as p90 instead of the mean ([#​4920](livekit/livekit#4920)) - rtc: accept ICE Completed in ICE-restart connect assertions ([#​4921](livekit/livekit#4921)) - rtc: measure data blob keys by their content, not their text form ([#​4923](livekit/livekit#4923)) - Remove deprecatred way of setting prometheus from the config file ([#​4928](livekit/livekit#4928)) - test: give mock participants a connection quality, close test rooms ([#​4933](livekit/livekit#4933)) - update warp dep ([#​4943](livekit/livekit#4943)) ##### Fixed - Do not add down tracks after receiver close ([#​4857](livekit/livekit#4857)) - Do not request media sections for transceivers that cannot send ([#​4892](livekit/livekit#4892)) - Deregister agent job when the server terminates it ([#​4893](livekit/livekit#4893)) - sfu: don't hold bindLock across the blank-frame flush in CloseWithFlush ([#​4895](livekit/livekit#4895)) - dynacast: re-send subscribed qualities after every publisher answer ([#​4907](livekit/livekit#4907)) - agent: release JobTerminate handler when job ends before registration ([#​4908](livekit/livekit#4908)) - Report disconnected for older disconnected participants. ([#​4910](livekit/livekit#4910)) - rtc: record a room's departure when the participant leaves it ([#​4913](livekit/livekit#4913)) - update deps to fix warp issue ([#​4916](livekit/livekit#4916)) - sfu: fix data stats active window bitrate and duration units ([#​4922](livekit/livekit#4922)) - fix: reject instead of drop for no dispatch rule ([#​4927](livekit/livekit#4927)) - fix: skip RTX/FEC when picking a fallback video codec ([#​4930](livekit/livekit#4930)) - fix: do not read invalid delta ([#​4935](livekit/livekit#4935)) - fix: use the fast debounce for the first negotiation ([#​4936](livekit/livekit#4936)) - fix: skip DTLS HelloVerifyRequest ([#​4937](livekit/livekit#4937)) - config: parse generated duration flags as durations ([#​4939](livekit/livekit#4939)) - fix: use the most common recent packet rate in connection quality ([#​4940](livekit/livekit#4940)) - fix: copy RED history packets instead of keeping pointers ([#​4941](livekit/livekit#4941)) - fix: keep one subscription when first subscribes race ([#​4944](livekit/livekit#4944)) - bump protocol to get unlock on no key fix ([#​4945](livekit/livekit#4945)) - fix: count leftover upstream loss after RTX repairs ([#​4946](livekit/livekit#4946)) - fix: switch VP8 temporal layer up only at a layer sync frame ([#​4947](livekit/livekit#4947)) - fix: reconcile everything when the reconcile queue overflows ([#​4948](livekit/livekit#4948)) - fix: enable H.264 publish for desktop Linux Firefox ([#​4949](livekit/livekit#4949)) </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/London) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNTUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE1NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.hayden.moe/hayden/phoebe/pulls/854
Refs #4724. Deliberately not
Fixes— this addresses the silent-degrade half ofthat issue, not the request for rate-based pacing, so I have left it open for you
to decide.
send_side_bwe_pacer: leaky-bucketis accepted by the config loader and thensilently ignored:
PacerBehaviorLeakybucketis defined inpkg/sfu/pacerandLeakyBucketis fully implemented, but the selection switch inNewPCTransportonly handlespass-throughandno-queue, soleaky-bucketfalls through to
default:and getsNewNoQueue. A typo likeleakybucketbehaves identically. Either way the server starts, reports nothing, and runs a
pacer the operator did not ask for.
This PR does not wire
leaky-bucketup, because doing so naively would be aregression rather than a fix — see the note below. It makes the current
behaviour observable instead:
CongestionControlConfig.Validate()rejects an unrecognisedsend_side_bwe_pacerat startup, naming the bad value and the accepted ones.Called from
NewConfignext to the existingRTC.Validate. A typo now failsfast instead of silently degrading.
default:branch inNewPCTransportlogs a warning naming the requestedpacer and the fallback, so a
leaky-bucketrequest is visible in the log.send_side_bwe_pacer(anduse_send_side_bwe) are documented inconfig-sample.yaml, where neither appeared before.rejected ones.
pkg/sfu/pacerhas no test file, so it lives inpkg/config/config_test.goalongside the existingNewConfigtests.Why
leaky-bucketis not simply added as acaseLeakyBucketpaces to a bitrate supplied throughPacer.SetBitrate.SetBitrateandSetIntervalare on thePacerinterface,Baseno-ops both,and
LeakyBucketis the only real implementation — but no production codecalls either one. The sole caller in the tree is
capturingPacerinpkg/sfu/downtrack_downstream_integration_test.go, which is test-only.So a wired
LeakyBucketwould pace at its static constructor bitrate foreverand ignore the send-side bandwidth estimate. That is worse than the current
fallback, and it looks like the reason the case was left out in the first place.
Making that reachable needs the stream allocator's estimate plumbed through to
Pacer.SetBitrate, which is a behavioural change to congestion control ratherthan a config fix, so I have kept it out of this PR.
That also answers @eilon-decart's third question in #4724 ("any known caveats
that led to it being left unwired?") as far as I can tell from the code: the
rate input has no producer. I would be glad to do the allocator plumbing in a
follow-up if that is the direction you want and if
LeakyBucketis consideredproduction-ready — happy to drop this in favour of a different approach if you
would rather handle it another way.
Disclosure: I work at DIDWW, a SIP trunking / DID provider; we are building on
LiveKit and LiveKit SIP. This particular fix has no telephony angle — I hit it
while reading the congestion control config.