Repository navigation
Conversation
AdaAibaby
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
November 6, 2026 06:15
AdaAibaby
force-pushed
the
fix/grpc-service-config-literal-json
branch
from
November 6, 2026 06:26
4519f8b to
6c278c9
Compare
…importing proto secrets.go built the default gRPC service config via the buf.build service_config protobuf. That proto transitively imports grpc/lookup/v1/rls.proto, whose descriptor is registered a second time by grpc-go's own internal grpc_lookup_v1 package, so any binary (incl. the packages/api/internal/handlers test binary) panics at init with "rls.proto is already registered". Build the service config as a string literal instead — byte-for-byte what protojson previously emitted for round_robin + the health-check service name — and drop the buf.build service_config / protojson / wrapperspb imports. Client behavior is unchanged; the handlers test binary no longer panics at init.
AdaAibaby
force-pushed
the
fix/grpc-service-config-literal-json
branch
from
November 9, 2026 03:33
6c278c9 to
ccd3350
Compare
This branch has not been deployed
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.
Problem
Any binary that links
packages/api/internal/handlers(including its test binary) panics at init:Minimal repro / root cause
handlers/secrets.goimportedbuf.build/gen/go/grpc/grpc/protocolbuffers/go/grpc/service_configpurely to build the default gRPC service-config JSON.service_configproto transitively importsgrpc/lookup/v1/rls.proto(RLS load-balancing config).google.golang.org/grpc(>= v1.84) ships its own internal copy of that descriptor atgoogle.golang.org/grpc/internal/proto/grpc_lookup_v1.grpc/lookup/v1/rls.proto→protoregistrypanics on the second init.go mod whyshows the chain is pulled in only viasecrets.go→service_config→lookup/v1; the main module does not otherwise need it.Reproduce:
go test ./packages/api/internal/handlers/(panics at init before any test runs).Fix
Build the service config as a string literal — byte-for-byte what
protojsonpreviously emitted:{"loadBalancingConfig":[{"round_robin":{}}], "healthCheckConfig":{"serviceName":"..."}}and drop the
buf.buildservice_configimport (plus the now-unusedprotojson/wrapperspb). gRPC client behavior is unchanged (round-robin LB + health-check readiness service); the handlers test binary no longer panics at init.Why separate
This is an independent, pre-existing bug (present on
main, unrelated to the template-artifact cleanup work). The template-artifact PRs (#3797/#3798) need this merged for theirhandlers-package unit tests to run in CI; their DB-backed tests pass independently.Test
go build ./...clean;go test ./packages/api/internal/handlers/no longer panics at init./cc @ryan-sana Looking forward to your code review.