-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
WIP - Upgrade GRPC/Proto to Latest #2857
Conversation
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2857 +/- ##
=======================================
Coverage 95.91% 95.91%
=======================================
Files 223 223
Lines 9695 9699 +4
=======================================
+ Hits 9299 9303 +4
- Misses 326 327 +1
+ Partials 70 69 -1
Continue to review full report at Codecov.
|
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
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.
Is model/model/model.pb.go
file needed?
model/codec.go
Outdated
// Unmarshal implements encoding.Codec | ||
func (c *gogoCodec) Unmarshal(data []byte, v interface{}) error { | ||
return proto.Unmarshal(data, v.(proto.Message)) | ||
} |
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.
I assume this is already explicitly covered by the existing tests for marshalling.
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.
Yes, all grpc/proto marshalling/unmarshalling will now go through this file.
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Nope. Has been removed. |
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
@@ -0,0 +1,48 @@ | |||
// Copyright (c) 2021 The Jaeger Authors. |
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.
maybe putting this into /model
is better, because no other APIs can be used without model, but not vice versa.
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.
I also prefer model, but this is where the cracks in this approach show. At this point what I have pushed works, but it is based on the ordering of the init()
in two different packages. The init method in /proto-gen/api_v2/codec.go
has to occur after this init:
https://github.com/grpc/grpc-go/blob/master/encoding/proto/proto.go#L33
The only package in Jaeger that eventually includes google.golang.org/grpc/encoding/proto
is api_v2
so putting codec.go in this package guarantees that we are called second and gogoproto is the registered coded for proto with grpc. See this code to see the registration process.
What this means is that future, unrelated changes to Jaeger could magically break this by accidentally calling the grpc/encoding/proto
init after our init. The good news is that CI would catch this, the bad news is that this is bad.
I don't hate this change. It allows us to stay up to date with OTel and grpc, but there are obvious drawbacks. I support either moving forward (with additional comments in codec.go to explain the above issue) or being patient with gogoproto for a few months to see if things resolve.
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.
I am also fine with this, but I suggest literally pasting your explanation into the comments.
Also, if we move codec.go into model/, can we not add an _ import into it to ensure that grpc/encoding/proto
is called first?
github is not updating, but currently all tests are passing aside from "CIT Memory And Badger". It is failing with
I will look into this when I get a chance. |
It would be exercising gRPC storage plugin infra. A bit concerning that it fails, since wire format / handshakes should not have changed with gRPC upgrade. |
I wonder if this has something to do with grpc-plugin module itself and which version of gRPC it usees. There isn't good logging from the test, unfortunately, my guess is that either start-up fails of the initial handshake fails
|
Signed-off-by: Joe Elliott <[email protected]>
Ok, I hit what may be a real blocker that requires either serious changes in the hashicorp go plugin or gogoproto. The memstore plugin is exiting with the below error. (Others are seeing similar issues.)
Which comes from this line in the gogo proto unmarshalling code: This is coming from hashicorps use of the Empty type here: The empty type is now a wrapper around a google.golang.org/protobuf type here: Note that the So I can actually get tests to pass by ignoring these fields, but I have to directly edit gogo proto vendored code to do it. Tests pass by extending this line to include the new fields: https://github.com/gogo/protobuf/blob/master/proto/table_unmarshal.go#L327
I don't think I can take this any farther. The above change technically works, but doesn't feel like a valuable PR to gogoproto. I don't have any real, deep understanding of what this change does in the broader context of proto parsing. |
done in #3056 thanks @joe-elliott and @albertteoh for the prior work |
Which problem is this PR solving?
Short description of the changes
generateAndRegisterManualResolver
/proto-gen/api_v2/codec.go
. This forces grpc to use gogoproto over google proto.