Skip to content

Commit 12beabc

Browse files
Przemysław Stępieńblesniewski
andauthored
chore: Double the limit of grpc messages (#2131)
#### Summary <!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 --> Following up on the transformer hanging issue reported by a customer and addressed in PR [#2130](#2130): Currently, the transformer plugin can increase the message size beyond the limit enforced in the sync method of plugin-sdk [1](https://github.com/cloudquery/plugin-sdk/blob/bc50fd3d2be414edba8f8ad5bb7739a012840bf1/internal/servers/plugin/v3/plugin.go#L267). To accommodate scenarios where transformers or destination plugins need to handle larger messages than the source plugin, we should consider increasing this limit to provide more flexibility. <!-- Explain what problem this PR addresses --> --- Use the following steps to ensure your PR is ready to be reviewed - [ ] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md) 🧑‍🎓 - [ ] Run `go fmt` to format your code 🖊 - [ ] Lint your changes via `golangci-lint run` 🚨 (install golangci-lint [here](https://golangci-lint.run/usage/install/#local-installation)) - [ ] Update or add tests 🧪 - [ ] Ensure the status checks below are successful ✅ --------- Co-authored-by: Bartosz Lesniewski <bartosz@cloudquery.io>
1 parent a65b101 commit 12beabc

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

examples/simple_plugin/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require (
3434
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
3535
github.com/cloudquery/cloudquery-api-go v1.13.8 // indirect
3636
github.com/cloudquery/codegen v0.3.26 // indirect
37-
github.com/cloudquery/plugin-pb-go v1.26.9 // indirect
37+
github.com/cloudquery/plugin-pb-go v1.26.10 // indirect
3838
github.com/cloudquery/plugin-sdk/v2 v2.7.0 // indirect
3939
github.com/davecgh/go-spew v1.1.1 // indirect
4040
github.com/ghodss/yaml v1.0.0 // indirect

examples/simple_plugin/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ github.com/cloudquery/cloudquery-api-go v1.13.8 h1:8n5D0G2wynbUdexr1GS8ND8i0uOwm
5454
github.com/cloudquery/cloudquery-api-go v1.13.8/go.mod h1:ZhEjPkDGDL2KZKlQLUnsgQ0mPz3qC7qftr37q3q+IcA=
5555
github.com/cloudquery/codegen v0.3.26 h1:cWORVpObYW5/0LnjC0KO/Ocg1+vbZivJfFd+sMpb5ZY=
5656
github.com/cloudquery/codegen v0.3.26/go.mod h1:bg/M1JxFvNVABMLMFb/uAQmTGAyI2L/E4zL4kho9RFs=
57-
github.com/cloudquery/plugin-pb-go v1.26.9 h1:lkgxqIzabD6yvDm7D7oJvgO/T/bYIh7SSOojEgbMpnA=
58-
github.com/cloudquery/plugin-pb-go v1.26.9/go.mod h1:euhtVJKRtmWzukBxOjJyCKHPU9O9Gs5vasiBCaZVFRA=
57+
github.com/cloudquery/plugin-pb-go v1.26.10 h1:VNRk3JMLR7+pCXGCk4729I8r3vTrn64qonCs+4KY7+M=
58+
github.com/cloudquery/plugin-pb-go v1.26.10/go.mod h1:OVk5GXAlz8u6+sNlBgYxzpP+pYU+TqyyQV6FqMBBcIM=
5959
github.com/cloudquery/plugin-sdk/v2 v2.7.0 h1:hRXsdEiaOxJtsn/wZMFQC9/jPfU1MeMK3KF+gPGqm7U=
6060
github.com/cloudquery/plugin-sdk/v2 v2.7.0/go.mod h1:pAX6ojIW99b/Vg4CkhnsGkRIzNaVEceYMR+Bdit73ug=
6161
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ require (
1212
github.com/aws/aws-sdk-go-v2/service/marketplacemetering v1.29.0
1313
github.com/bradleyjkemp/cupaloy/v2 v2.8.0
1414
github.com/cloudquery/cloudquery-api-go v1.13.8
15-
github.com/cloudquery/plugin-pb-go v1.26.9
15+
github.com/cloudquery/codegen v0.3.26
16+
github.com/cloudquery/plugin-pb-go v1.26.10
1617
github.com/cloudquery/plugin-sdk/v2 v2.7.0
1718
github.com/goccy/go-json v0.10.5
1819
github.com/golang/mock v1.6.0
@@ -65,7 +66,6 @@ require (
6566
github.com/bahlo/generic-list-go v0.2.0 // indirect
6667
github.com/buger/jsonparser v1.1.1 // indirect
6768
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
68-
github.com/cloudquery/codegen v0.3.26 // indirect
6969
github.com/davecgh/go-spew v1.1.1 // indirect
7070
github.com/ghodss/yaml v1.0.0 // indirect
7171
github.com/go-logr/logr v1.4.2 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ github.com/cloudquery/codegen v0.3.26 h1:cWORVpObYW5/0LnjC0KO/Ocg1+vbZivJfFd+sMp
5656
github.com/cloudquery/codegen v0.3.26/go.mod h1:bg/M1JxFvNVABMLMFb/uAQmTGAyI2L/E4zL4kho9RFs=
5757
github.com/cloudquery/jsonschema v0.0.0-20240220124159-92878faa2a66 h1:OZLPSIBYEfvkAUeOeM8CwTgVQy5zhayI99ishCrsFV0=
5858
github.com/cloudquery/jsonschema v0.0.0-20240220124159-92878faa2a66/go.mod h1:0SoZ/U7yJlNOR+fWsBSeTvTbGXB6DK01tzJ7m2Xfg34=
59-
github.com/cloudquery/plugin-pb-go v1.26.9 h1:lkgxqIzabD6yvDm7D7oJvgO/T/bYIh7SSOojEgbMpnA=
60-
github.com/cloudquery/plugin-pb-go v1.26.9/go.mod h1:euhtVJKRtmWzukBxOjJyCKHPU9O9Gs5vasiBCaZVFRA=
59+
github.com/cloudquery/plugin-pb-go v1.26.10 h1:VNRk3JMLR7+pCXGCk4729I8r3vTrn64qonCs+4KY7+M=
60+
github.com/cloudquery/plugin-pb-go v1.26.10/go.mod h1:OVk5GXAlz8u6+sNlBgYxzpP+pYU+TqyyQV6FqMBBcIM=
6161
github.com/cloudquery/plugin-sdk/v2 v2.7.0 h1:hRXsdEiaOxJtsn/wZMFQC9/jPfU1MeMK3KF+gPGqm7U=
6262
github.com/cloudquery/plugin-sdk/v2 v2.7.0/go.mod h1:pAX6ojIW99b/Vg4CkhnsGkRIzNaVEceYMR+Bdit73ug=
6363
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=

serve/constants.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
const (
88
// bufSize used for unit testing grpc server and client
9-
testBufSize = 1024 * 1024
10-
flushTimeout = 5 * time.Second
11-
MaxMsgSize = 100 * 1024 * 1024 // 100 MiB
9+
testBufSize = 1024 * 1024
10+
flushTimeout = 5 * time.Second
11+
MaxGrpcMsgSize = 200 * 1024 * 1024 // 200 MiB
1212
)

serve/plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ func (s *PluginServe) newCmdPluginServe() *cobra.Command {
179179
grpc.ChainStreamInterceptor(
180180
logging.StreamServerInterceptor(grpczerolog.InterceptorLogger(logger)),
181181
),
182-
grpc.MaxRecvMsgSize(MaxMsgSize),
183-
grpc.MaxSendMsgSize(MaxMsgSize),
182+
grpc.MaxRecvMsgSize(MaxGrpcMsgSize),
183+
grpc.MaxSendMsgSize(MaxGrpcMsgSize),
184184
)
185185
s.plugin.SetLogger(logger)
186186
pbv3.RegisterPluginServer(grpcServer, &serversv3.Server{

0 commit comments

Comments
 (0)