-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
reflection: don't serialize placeholders #6771
reflection: don't serialize placeholders #6771
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
If you have some idea how to explain "placeholder" better in a user-friendly changelog message (I said "not completely defined"???) then please update the |
@dfawley, another way is to frame it more like the title of the corresponding issue (#6770):
WDYT? I went ahead and updated the description in case that looks good to you. |
LGTM! |
LGTM, thanks for the fix @jhump |
@arvindbr8 Hello. This update broke all popular clients with Reflection API support. Postman, Insomnia, grpcurl can't read API via reflection due to missing IsPlaceholder() on line https://github.com/grpc/grpc-go/blob/master/reflection/serverreflection.go#L189. Add various imports (validation, openapiv2) to proto and see for yourself that reflection in clients will not be read. And reflection API in Postman, Insomnia, grpcurl worked. |
@nikitaksv, this is not true. I have plenty of examples of working protos with those imports, and reflection works fine with them. This only happens if you use the wrong import path when importing those files. (See https://buf.build/docs/reference/protobuf-files-and-packages#imports for more info.) For example for openapiv2, you must use the following path: import "protoc-gen-openapiv2/options/annotations.proto"; If your import references that file using any other path, then the descriptors cannot be correctly linked at runtime. The placeholder descriptors are junk -- they come across as empty files at best (as of this fix) or as invalid, broken files (before that fix). What library were you using in your reflection clients that they could successfully process these descriptors? I know that |
Resolves #6770.
On a related note, I'm also trying to land a patch to the protobuf runtime:
https://go-review.googlesource.com/c/protobuf/+/540455
I think both that and this fix are useful. This one is likely more useful since a "not found" error for a particular file will be a better error message to users, given that the issue is in fact that an imported file is missing from the global registry.
RELEASE NOTES: