Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: GRPC health #1690

Merged
merged 11 commits into from
Sep 12, 2024
3 changes: 3 additions & 0 deletions protocol/chainlib/grpcproxy/grpcproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"golang.org/x/net/http2/h2c"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)
Expand All @@ -28,6 +30,7 @@ type HealthReporter interface {
func NewGRPCProxy(cb ProxyCallBack, healthCheckPath string, cmdFlags common.ConsumerCmdFlags, healthReporter HealthReporter) (*grpc.Server, *http.Server, error) {
serverReceiveMaxMessageSize := grpc.MaxRecvMsgSize(MaxCallRecvMsgSize) // setting receive size to 32mb instead of 4mb default
s := grpc.NewServer(grpc.UnknownServiceHandler(makeProxyFunc(cb)), grpc.ForceServerCodec(RawBytesCodec{}), serverReceiveMaxMessageSize)
grpc_health_v1.RegisterHealthServer(s, health.NewServer())
wrappedServer := grpcweb.WrapServer(s)
handler := func(resp http.ResponseWriter, req *http.Request) {
// Set CORS headers
Expand Down
1 change: 0 additions & 1 deletion protocol/rpcprovider/provider_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func NewProviderListener(ctx context.Context, networkAddress lavasession.Network
grpc.MaxRecvMsgSize(1024 * 1024 * 32), // setting receive size to 32mb instead of 4mb default
}
grpcServer := grpc.NewServer(opts...)

wrappedServer := grpcweb.WrapServer(grpcServer)
handler := func(resp http.ResponseWriter, req *http.Request) {
// Set CORS headers
Expand Down
Loading