Skip to content

Commit

Permalink
feat: GRPC health (#1690)
Browse files Browse the repository at this point in the history
* grpc_health_v1

* consumer health server

* a test commit, can be reverted if nessesary

* rm toolchain

* testify

* Revert "grpc_health_v1"

This reverts commit 1769d61.

* Reapply "grpc_health_v1"

This reverts commit 9086a5c.

* Revert "a test commit, can be reverted if nessesary"

This reverts commit 659b341.

* remove health for provider
  • Loading branch information
amitza committed Sep 12, 2024
1 parent 66aaf13 commit d0a883c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit d0a883c

Please sign in to comment.