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

Conditionalize MaxRecvMessageSize #40

Open
vibe opened this issue Sep 25, 2024 · 2 comments
Open

Conditionalize MaxRecvMessageSize #40

vibe opened this issue Sep 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@vibe
Copy link

vibe commented Sep 25, 2024

There was a need to bump MaxRecvMessageSize across all our functions recently with the upgrade to the new v1 sdk, this included function-auto-ready.

Just dropping an issue to track this, and get some feedback about where the best place to implement this is.

Simple fix is to update the fn.Serve with function.MaxRecvMessageSize(c.MaxGRPCMessageSize).

Could either happen at each function level, or function-sdk-go template.

@vibe vibe added the enhancement New feature or request label Sep 25, 2024
@jbw976
Copy link
Member

jbw976 commented Sep 25, 2024

Would you be able to add a bit more detail on what the problem is here @vibe? I don't fully understand the scope and impact just yet 🤔

@vibe
Copy link
Author

vibe commented Sep 30, 2024

Would you be able to add a bit more detail on what the problem is here @vibe? I don't fully understand the scope and impact just yet 🤔

Sure @jbw976.

Essentially, in Go's gRPC library, the default maximum received message size is 4MB. So messages sent between composition functions need to be remain under this limit, since this includes the observed composite resource and the desiresd resources, this message size can increase as more resources are being generated by a composition pipeline.

A few months ago we hit the 4MB limit (our composition, provisions large amounts of EC2 with custom user data), we then refactored the user data so that the total size would fall below 4MB.

Fast forward to last week: We bumped our function-sdk-go to 0.3.0 and the message size between our composition increased resulting in an error along the lines of received message larger than max (420000 vs. 4194304)". Rolling back the function-sdk-go lowered the message size.

We were easily able to update our own function's MaxRecvMessageSize but not function-auto-ready so we had to fork it and make the change.

It makes sense function-template-go is updated, along with any other functions that may need this change.

I can work on a PR soon.

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

No branches or pull requests

2 participants