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

C#: Increase recursionLimit for MessageParser #7995

Closed
mikhailshilkov opened this issue Oct 30, 2020 · 3 comments
Closed

C#: Increase recursionLimit for MessageParser #7995

mikhailshilkov opened this issue Oct 30, 2020 · 3 comments
Assignees
Labels

Comments

@mikhailshilkov
Copy link

What language does this apply to?
C#

Describe the problem you are trying to solve.
No way to set recursionLimit via MessageParser.

gRPC library for .NET has this issue where it fails to parse a message with high recursion. However, there's seemingly no hook to configure a MessageParser (the entry point that the generated gRPC code uses) to increase the default recursion limit from 100 to an arbitrary value.

Describe the solution you'd like
Have a configuration value to set a recursion limit to a higher value, either on a MessageParser level or globally.

Describe alternatives you've considered

Additional context
Downstream issue: pulumi/pulumi#4224

@gitfool
Copy link

gitfool commented Nov 1, 2020

This is a problem in particular for Kubernetes resources which have many nested elements when represented as yaml, combined with using unstructured data via Google.Protobuf.WellKnownTypes.Struct, which effectively reduces the recursion limit by a factor of 3x.

A much needed quick fix could be to simply increase the default recursion limit to account for this, from 100 to 300 or more, and a long term configurable limit could be devised after said quick fix is released.

@jtattermusch jtattermusch self-assigned this Nov 2, 2020
@jtattermusch jtattermusch added the c# label Nov 2, 2020
@jtattermusch
Copy link
Contributor

I think the right solution would be to provide a hook for configuring the marshallers in gRPC. Increasing the limit globally for everyone doesn't sound like a good solution.

@jtattermusch
Copy link
Contributor

I filed grpc/grpc-dotnet#1983 to address the root cause of this and I'm going to close this issue as changing the default recursion limit doesn't really solve the problem (as different projects will need different recursion limits).

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

No branches or pull requests

3 participants