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

Add Possibility to increase max receive/send message size #149

Closed
wants to merge 0 commits into from

Conversation

davidelienhard
Copy link
Contributor

@davidelienhard davidelienhard commented Jul 8, 2024

Description of your changes

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

sdk.go Outdated Show resolved Hide resolved
@davidelienhard davidelienhard requested a review from negz July 30, 2024 09:01
sdk.go Outdated Show resolved Hide resolved
@davidelienhard davidelienhard requested a review from negz July 31, 2024 08:03
Copy link
Member

@negz negz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @davidelienhard! One question just to make sure I understand what this is doing, but the approach LGTM.

sdk.go Outdated
@@ -141,7 +149,7 @@ func Serve(fn v1beta1.FunctionRunnerServiceServer, o ...ServeOption) error {
return errors.Wrapf(err, "cannot listen for %s connections at address %q", so.Network, so.Address)
}

srv := grpc.NewServer(grpc.MaxRecvMsgSize(so.MaxMsgSize), grpc.MaxSendMsgSize(so.MaxMsgSize), grpc.Creds(so.Credentials))
srv := grpc.NewServer(grpc.MaxMsgSize(so.MaxMsgSize), grpc.MaxRecvMsgSize(so.MaxMsgSize), grpc.MaxSendMsgSize(so.MaxMsgSize), grpc.Creds(so.Credentials))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between max size vs max recv size and max send size?

Does Crossplane (the client) need to be configured to agree on message size with the function (the server)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, maxSize is actually equal to max recv size, it is going to be deprecated (we could already remove it actually, I had done it but in the last commit apparently I forgot it and added it again by mistake)
The difference between receive and send size is:

  • receive: if the incoming message exceeds the size it refuses to read the message
  • send: it cannot send messages larger than the maximum

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a commit deleting the grpc.MaxMsgSize(so.MaxMsgSize) since it is going to be deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your comment I saw on the documentation that the default value for sendMsgSize is math.MaxInt32 and not the same as recvsize, therefore i modified the repo adding a commit, now the serveOption just modifies the RecvMsgSize and not the Send as well

@negz
Copy link
Member

negz commented Aug 5, 2024

Thanks! This looks good, but it's not passing DCO. Could you squash down to one commit, and make sure that commit is signed off. Once that's done I can merge.

@davidelienhard
Copy link
Contributor Author

davidelienhard commented Aug 6, 2024

Hi, I had to close this pull request and am opening a new one with the modifications you said

This is the link
#153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants