Prototype of customizable recursion and size limits for message parsing
cc @JamesNK @EronWright
Obviously this has no tests, but it's an alternative to #17881.
I don't know how the gRPC generator would be configured to change the parser settings, but the result could be a change from:
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.Functions.V2.GetFunctionRequest>
__Marshaller_google_cloud_functions_v2_GetFunctionRequest =
grpc::Marshallers.Create(__Helper_SerializeMessage, context =>
__Helper_DeserializeMessage(context, global::Google.Cloud.Functions.V2.GetFunctionRequest.Parser));
to
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.Functions.V2.GetFunctionRequest>
__Marshaller_google_cloud_functions_v2_GetFunctionRequest =
grpc::Marshallers.Create(__Helper_SerializeMessage, context =>
__Helper_DeserializeMessage(context, global::Google.Cloud.Functions.V2.GetFunctionRequest.Parser
.WithRecursionLimit(500)));
Causes for concern (beyond the current lack of tests):
- Additional complexity in MessageExtensions and CodedInputStream
- Potential performance regression due to dereferencing Settings frequently
- Having an "immutable" Settings type referring to a mutable ExtensionRegistry is a code smell, but that's an existing issue.
Any update on this, @jskeet ?
@JasonLunn: I haven't had any feedback, and don't have the time to chase at the moment I'm afraid.
This looks reasonable to me, although tests would be nice
@mkruskal-google: I'll definitely add tests before we merge :) I'd like feedback on the API surface from potential consumers such as @JamesNK before writing those tests though.
We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please add a comment.
This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.
We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active or becomes active again, please reopen it.
This PR was closed and archived because there has been no new activity in the 14 days since the inactive label was added.