Skip to content

Commit 7102e93

Browse files
committed
Fix grpc send and receive sizes.
1 parent 37addf9 commit 7102e93

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

legacy/app/archive-query-service/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func run() error {
4444
StatusDataCacheTtl time.Duration `conf:"default:1s"` // nolint:revive
4545
EmptyTicksTtl time.Duration `conf:"default:24h"` // nolint:revive
4646
MaxRecvSizeInMb int `conf:"default:1"`
47-
MaxSendSizeInMb int `conf:"default:10"`
47+
MaxSendSizeInMb int `conf:"default:2"`
4848
}
4949
ElasticSearch struct {
5050
Address []string `conf:"default:https://localhost:9200"`

legacy/rpc/rpc_server.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,11 +717,13 @@ func (s *Server) Start(cfg StartConfig, interceptors ...grpc.UnaryServerIntercep
717717
mux := runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{
718718
MarshalOptions: protojson.MarshalOptions{EmitDefaultValues: true, EmitUnpopulated: true},
719719
}))
720+
// Configuration for the http gateway grpc client (http request -> http gateway (grpc client) -> grpc server)
721+
// The send and recv values are reversed on purpose as the client's send is the server's receive and vice versa.
720722
opts := []grpc.DialOption{
721723
grpc.WithTransportCredentials(insecure.NewCredentials()),
722724
grpc.WithDefaultCallOptions(
723-
grpc.MaxCallRecvMsgSize(cfg.MaxRecvMsgSize),
724-
grpc.MaxCallSendMsgSize(cfg.MaxSendMsgSize),
725+
grpc.MaxCallRecvMsgSize(cfg.MaxSendMsgSize),
726+
grpc.MaxCallSendMsgSize(cfg.MaxRecvMsgSize),
725727
),
726728
}
727729
if err := protobuf.RegisterTransactionsServiceHandlerFromEndpoint(

v2/cmd/archive-query-service/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func run() error {
4848
CacheEnabled bool `conf:"default:false"`
4949
CacheTTLFile string `conf:"default:cache_ttl.json"`
5050
MaxRecvSizeInMb int `conf:"default:1"`
51-
MaxSendSizeInMb int `conf:"default:10"`
51+
MaxSendSizeInMb int `conf:"default:2"`
5252
}
5353
Pagination struct {
5454
MaxPageSize uint32 `conf:"default:1000"`

v2/grpc/server.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ func (s *ArchiveQueryService) Start(cfg StartConfig, errCh chan error, intercept
4646
mux := runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{
4747
MarshalOptions: protojson.MarshalOptions{EmitDefaultValues: true, EmitUnpopulated: true},
4848
}))
49+
// Configuration for the http gateway grpc client (http request -> http gateway (grpc client) -> grpc server)
50+
// The send and recv values are reversed on purpose as the client's send is the server's receive and vice versa.
4951
opts := []grpc.DialOption{
5052
grpc.WithTransportCredentials(insecure.NewCredentials()),
5153
grpc.WithDefaultCallOptions(
52-
grpc.MaxCallRecvMsgSize(cfg.MaxRecvMsgSize),
53-
grpc.MaxCallSendMsgSize(cfg.MaxSendMsgSize),
54+
grpc.MaxCallRecvMsgSize(cfg.MaxSendMsgSize),
55+
grpc.MaxCallSendMsgSize(cfg.MaxRecvMsgSize),
5456
),
5557
}
5658

0 commit comments

Comments
 (0)