Do not start GRPC server unless specified #1171
Merged
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.
Gate gRPC server startup behind
options.API.Enableand add a deprecation bridge for--replication.enablein cmd/replication/main.gooptions.Replication.Enabletooptions.API.Enable, including conditional DB init and API startup in cmd/replication/main.go, pkg/config/validation.go, and pkg/server/server.go.--api.enableis true; require a non-nil listener only when starting the API in pkg/server/server.go.--replication.enableis set without--api.enable, log a warning and setoptions.API.Enable=true.EnableandSendKeepAliveIntervalonconfig.APIOptions, deprecateconfig.ReplicationOptionstoEnableonly, and add-pshort flag for port in pkg/config/options.go.config.APIOptionsandAPI: true, including pkg/api/message/service.go, pkg/testutils/server/server.go, and multiple tests.XMTPD_REPLICATION_ENABLEwithXMTPD_API_ENABLEin dev scripts and test utils in dev/run, dev/run-2, and pkg/integration/docker_utils_test.go.📍Where to Start
Start in the
mainfunction of cmd/replication/main.go to see option consolidation, deprecation handling, and the new API gating, then follow intoserver.NewReplicationServerin pkg/server/server.go.Macroscope summarized 7d7a28f.