add bus compression settings to PSRPCConfig - #1771
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 58b6510 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
psrpc v0.7.6 adds opt-in gzip at the bus boundary. Surface it as a psrpc.compression yaml block so every service that already carries a PSRPCConfig can enable it, and add BusOptions() as the single conversion into psrpc bus options. Compression stays off by default: a peer on an older psrpc cannot decode a compressed payload and its subscription read loop drops it silently, so a deployment has to be fully upgraded before quality is raised. The grpc patch bump comes from psrpc v0.7.6 via MVS.
paulwe
force-pushed
the
psrpc-bus-compression-config
branch
from
September 5, 2026 11:58
f4be23a to
abec128
Compare
paulwe
force-pushed
the
psrpc-bus-compression-config
branch
from
September 5, 2026 12:00
3d53775 to
53de1cb
Compare
boks1971
approved these changes
Sep 5, 2026
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.
Surfaces the opt-in gzip compression added in psrpc#130 (released as v0.7.6) as configuration, so services that already carry a
PSRPCConfigcan enable it from theirpsrpc:yaml block.Shape
CompressionConfigis its own type rather than an alias forpsrpc.CompressionOpts. The fields match one for one, butCompressionOptscarries no yaml tags, so keys would marshal asmaxdecompressedsize, and livekit-server'sconfigtest.CheckYAMLTagsrecurses into nested config structs and requiresomitemptyon every exported non-bool field.BusOptions()is the single conversion into psrpc bus options, alongside the existing(*ClientParams).Options(). Value receiver, becausegetPSRPCConfig(conf)returns a non-addressablePSRPCConfig. It returns the option unconditionally:WithBusCompressionwithQuality <= 0leaves the compressor nil, andMaxDecompressedSizestill has to reach the read side when publishing is off.It stops short of a
rpc.NewMessageBushelper — livekit-server picks redis-vs-local, cloud uses NATS, and each is already a wire provider.Default is off
Qualitydefaults to zero. A peer on a psrpc older than v0.7.6 cannot decode a compressed payload, and psrpc's subscription read loop drops undecodable messages, so a deployment has to be fully upgraded before publishers raise it.Thresholdis seeded frompsrpc.DefaultCompressionThresholdso the effective value is visible in a dumped config.Notes
PSRPCConfig{...}literal isDefaultPSRPCConfighere, and it is keyed.google.golang.org/grpcpatch bump comes from psrpc v0.7.6 via MVS.