feat: add grpc-disabled config option for server#961
Open
kalleep wants to merge 2 commits into
Open
Conversation
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.
What this PR does:
Add config option to disable the grpc listener when creating a
Server. I named itGRPCDisabledto keep it consistent with other grpc related options.With this option the grpc listener is never created. The GRPC server is still created but will never be started, we could change this too if that is a preference.
Which issue(s) this PR fixes:
Fixes #954
Checklist
Note
Medium Risk
Changes core server startup/run behavior and introduces conditional gRPC initialization, which could impact deployments relying on gRPC being available or on side effects of HTTP-over-gRPC registration.
Overview
Adds a new
Config.GRPCDisabled(YAMLgrpc_disabled+-server.grpc-disabledflag) to optionally skip creating the gRPC listener.When enabled, server startup now avoids gRPC listener setup (including PROXY protocol wrapping), adjusts startup logging, and skips registering/serving the HTTP-over-gRPC handler;
GRPCListenAddr()returnsnilin this mode. AddsTestGRPCDisabledto verify HTTP still serves while gRPC is not listening.Reviewed by Cursor Bugbot for commit 393913c. Bugbot is set up for automated code reviews on this repo. Configure here.