-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Phase 1 to add the server interceptor #642
Conversation
…ion. See grpc/grpc-go#642 for the corresponding grpc-go change. Signed-off-by: David Symonds <dsymonds@golang.org>
The golang/protobuf change has been pushed: golang/protobuf@331aba2 |
This backwards-incompatible change broke builds for teammates and produced confusing errors. I can't find any explanation for the changes, nor can I see anything in the milestones which would have helped see that this was coming up. Is there anywhere I can subscribe to announcements of these kinds of breaking changes? |
@spenczar there are version checks in both grpc-go and go-protobuf specifically to ensure that the versions match. If you upgrade one, upgrade the other too. |
Sorry for the breakage. This breaks only if you cache and use the generated code directly. Otherwise, it should be transparent to users. Anyways, I am going to pay more attention on this and will announce any potential breaking changes on a github issue. You do not need to subscribe anywhere else. |
grpc/grpc-go#642. (We didn't pin the protobuf grpc Go plugin yet and got broken because of that.)
Drive-by/Quick question: Why do the handler methods/types take |
@riannucci It is because gRPC and protobuf are not a bundle. Users are allowed to use other things as their IDLs. But all the IDLs need to share this same API -- this interface{} could be a proto.Message or a slice or something else. |
Why code generation had to be changed? The interceptor in the generated code seems to be unnecessary because handler func doesn't pass any data to the interceptor that the caller of the handler func doesn't already have. Note that |
For the streaming rpc interceptor (which I am working on) the codegen is not changed. For unary rpc, we have to do that because protobuf decoding happens in the generated code. The interceptor impl needs to call handler(ctx, in) by itself to complete the rpc as usual if they want. We will have a doc to describe the design and show some examples. |
Yeah, I see. I just tried to write a patch for |
Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement. After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.
Regards, |
No description provided.