Allow missing extension ranges since not all messages are extended#497
Allow missing extension ranges since not all messages are extended#497Kvarnefalk wants to merge 1 commit intofullstorydev:masterfrom
Conversation
|
@Kvarnefalk, this is probably better off as an issue, to discuss. What was the actual command-line used? Were you using server reflection or providing proto sources or descriptor sets? If using server reflection, what was the actual RPC response from the server? I guess that isn't clear from the error message, which is unfortunate. But I think it would be better to handle this elsewhere, like in the source's implementation of |
|
Also, what version of |
|
Happy to reopen this as an issue if it makes more sense, or rewrite it to make This is the command I'm using: And here's the rpc error response (looks like it's coming from here in grpc-java) Using grpcurl 1.9.2 and io-grpc:grpc-services 1.67.1 |
Background & Problem
I'm working on a java grpc service that have a field of type
google.protobuf.DescriptorProtofrom descriptor.proto in the response message.When running
grpcurl, I'm hit with the following fatal error message:If I allow the grpcurl to continue past that error, I'm also getting errors on
google.protobuf.ExtensionRangeOptions.For context, here's the snippet where FeatureSet is reserving extensions:
Difference in grpcurl and java-grpc
grpcurlcallsdesc.MessageDescriptor.GetExtensionRanges(), which seems to return a list of the extension ranges above. However, java-grpc is callingFileDescriptor.getExtensions()ref. From what I can tell,getExtensions()is only returning a value if the message in question is extended by another message.For example, there are multiple other messages in
descriptor.protothat also declare extension ranges in the same way, that are not failing. However, for those, there are other messages extending the message. See envoy/annotations/deprecation.proto:Solution?
So it seems like, for
fetchAllExtensionsto properly work, all messages with an extension range declared must have another message extending that message? That feels like a thing that should not necessarily always be true. Rather we would allow no extensions to be found on the message, since that is expected if there are only extension ranges declared (and no other messages extending it).Please advise if this solution makes sense, or if you think it's rather grpc-java that should update their reflection service to account for non-extended messages.
Thanks for a great tool!