-
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
Upgrade gRPC to 1.38.x #3056
Upgrade gRPC to 1.38.x #3056
Conversation
proto-gen/api_v2/codec.go
Outdated
) | ||
|
||
func init() { | ||
encoding.RegisterCodec(newCodec()) |
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.
@bogdandrutu or @tigrannajaryan could you please loop in here? This PR updates to the latest gRPC and protobuf.
Jaeger uses gogo proto as OTELcol and it uses the same features - custom type for IDs and nonullable fields. To make this with the latest dependencies this codes registration is needed. I could not find the custom codec registration in OTELcol. Do you know why it is not needed?
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.
Do you know why it is not needed?
I am not very familiar with this specific functionality of gogo, I don't know the answer to this.
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.
thanks for looking at this. The answer why it works in the collector is here #3056 (comment)
e09a071
to
1e614d2
Compare
Codecov Report
@@ Coverage Diff @@
## master #3056 +/- ##
==========================================
- Coverage 95.97% 95.86% -0.11%
==========================================
Files 229 233 +4
Lines 9956 10057 +101
==========================================
+ Hits 9555 9641 +86
- Misses 330 345 +15
Partials 71 71
Continue to review full report at Codecov.
|
This is ready for review/merge |
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[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.
It would be good to have a review from someone with more experience with gRPC/Gogo, as I don't really understand how proto-gen/codec.go
fixes our problems.
In any case, is this something we'd want for the long-term, or do you think we still need a better solution in the future?
@@ -123,3 +125,12 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact | |||
|
|||
return conn, nil | |||
} | |||
|
|||
// generateAndRegisterManualResolver was removed from grpc. |
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.
Did they mention why it was removed?
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.
It seems they leave the work for the caller.
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.
Perhaps we should move to WithResolver
?
Not much info about why it was removed here.
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
correct, this is rather a short-term solution. Since the gogo is compatible only with go proto V1 and it will not be made compatible with v2 we will have to migrate. It seems that solutions like https://github.com/planetscale/vtprotobuf (based on gogo/protobuf#691 (comment)) will be way forward. It is a plugin for proto compiler that generates serialization methods, it does not modify generated model classes.
|
Signed-off-by: Pavol Loffay <[email protected]>
@joe-elliott / @yurishkuro could you please review? |
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.
Can you try running a ser/deser benchmark before this upgrade and after?
proto-gen/codec_test.go
Outdated
"github.com/jaegertracing/jaeger/model" | ||
) | ||
|
||
func TestCodecMarshallAndUnmarshall_jaeger_type(t *testing.T) { |
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.
are you sure tests are being executed in this proto-gen package? I thought we were excluding them (you have a fmt issue above so pretty sure linter is not running here). I think it's better not to mix generated code with manual code.
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.
To what package should we move this then? I can think of model
only.
I think it's better not to mix generated code with manual code.
We already do mix packages e.g. model
package.
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.
in the model we do it out of necessity, since gen-ed code doubles as domain model and the custom types ser/deset methods need to be there. But we usually don't write manual code in ***-gen packages.
You can create a new package like pkg/gogocodec
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.
The best would be get rid of this, I cannot find custom codec in OTELcol, so perhaps it's doable to do it without it.
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.
The custom codec is needed only if a custom type (e.g. TaceID) is used directly in the request (probably also response) object - https://github.com/jaegertracing/jaeger-idl/blob/master/proto/api_v2/query.proto#L38 via https://github.com/jaegertracing/jaeger-idl/blob/master/proto/api_v2/query.proto#L128. If the
TraceID` was wrapped into another message the serialization would work without the custom codec.
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.
@yurishkuro I have moved the codec to ./pkg/gogocodec
package and imported it in query grpc handler and grpc plugin code.
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Benchmark results look good to me. See the results below. The benchmark code is in this PR in the This PR:
Master with
Master with
|
Do I read it right that |
Signed-off-by: Pavol Loffay <[email protected]>
We do not use gogo only for perf but also for using custom types (e.g. |
Signed-off-by: Pavol Loffay <[email protected]>
@@ -44,6 +44,8 @@ func (s *GRPCStorageIntegrationTestSuite) initialize() error { | |||
err := command.ParseFlags([]string{ | |||
"--grpc-storage-plugin.binary", | |||
s.pluginBinaryPath, | |||
"--grpc-storage-plugin.log-level", |
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 think I added this when I was trying to determine why the plugin wasn't working. It's not necessary but I don't think it hurts anything either.
Builds on top of #2857
Resolves #2771
Resolves #2172