-
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
grpc: update clientStreamAttempt context with transport context #7096
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7096 +/- ##
==========================================
+ Coverage 81.29% 81.32% +0.03%
==========================================
Files 340 345 +5
Lines 33890 33926 +36
==========================================
+ Hits 27550 27590 +40
+ Misses 5178 5176 -2
+ Partials 1162 1160 -2
|
Great work!
Are we sure this fixes everything that #6947 talks about? If so, do you mind adding the test output to this PR? Also it's interesting that our CI didn't catch this. Let's add one as part of this change. One good place I can think of is to add this would be when |
Actually I would just add another go test for this. Let's not complicate this with adding it to |
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.
For accounting: so that you can re-request a review when its ready
9152685
to
1463ef5
Compare
test/stats_test.go
Outdated
|
||
ctx := context.Background() | ||
client := testgrpc.NewTestServiceClient(conn) | ||
interop.DoClientStreaming(ctx, client) |
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.
Might be useful to have a subtest for each RPC type (unary, bidi, etc)
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.
This doesnt seem to be resolved?
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.
Zach suggested here to have single RPC type.
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.
LGTM. I would like @zasweq to take a look at this as well.
test/stats_test.go
Outdated
} | ||
t.Cleanup(func() { | ||
if err := conn.Close(); err != nil { | ||
t.Error(err) |
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.
optional: This t.Error is not really in the essence of the test. I think maybe we can get rid of 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.
And 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.
done
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.
Looks great overall, some minor nits and replied to some comments with technical context.
test/stats_test.go
Outdated
// Define expected stats callouts and whether a peer object should be populated. | ||
// Note: | ||
// * Begin stats don't have peer information as the RPC begins before peer resolution. | ||
// * PickerUpdated stats don't have peer information as the picker operates without transport-level knowledge. |
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.
Please wrap comments to 80 characters. The guidance for this repo is comments wrapped to 80 characters, but we do not have a length maximum for code line characters.
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.
done
test/stats_test.go
Outdated
go func() { | ||
errCh <- grpcServer.Serve(l) | ||
}() | ||
t.Cleanup(func() { |
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 switch one below too?
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.
LGTM.
test/stats_test.go
Outdated
// verifies that peer is sent for OutPayload, InPayload, End | ||
// stats handlers. | ||
// verifies that peer is sent all stats handler callouts instead | ||
// of begin and pickerUpdated |
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.
Capitalize and period at the end.
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.
done
test/stats_test.go
Outdated
// Stats callouts & peer object population. | ||
// Note: | ||
// * Begin stats don't have peer information as the RPC begins before peer resolution. | ||
// * PickerUpdated stats don't have peer information as the picker operates without transport-level knowledge. | ||
// * Begin stats lack peer info (RPC starts pre-resolution). | ||
// * PickerUpdated: no peer info (picker lacks transport details). |
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.
No you can keep the full comment, just wrap it to 80 characters. Just make sure it wraps 80 by 80.
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.
done
test/stats_test.go
Outdated
go func() { | ||
errCh <- grpcServer.Serve(l) | ||
}() | ||
t.Cleanup(func() { |
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.
Ping on this.
72a3c5f
to
deb839a
Compare
Please figure out and fix the race condition before we merge 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.
Few comments from my previous pass seems to be unresolved, but marked resolved. Could you please respond to them before we can merge this?
test/stats_test.go
Outdated
|
||
ctx := context.Background() | ||
client := testgrpc.NewTestServiceClient(conn) | ||
interop.DoClientStreaming(ctx, client) |
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.
This doesnt seem to be resolved?
test/stats_test.go
Outdated
} | ||
t.Cleanup(func() { | ||
if err := conn.Close(); err != nil { | ||
t.Error(err) |
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.
And this?
test/stats_test.go
Outdated
client := testgrpc.NewTestServiceClient(cc) | ||
interop.DoClientStreaming(ctx, client) | ||
|
||
sc := getUniqueRPCStatsCount(psh.args) |
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 would inline the logic here, better for readability and this helper is only being used once.
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.
Added the comment
9decab5
to
4cdfa42
Compare
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.
LGTM
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.
lgtm
Fixes #6947
RELEASE NOTES:
OutPayload
,InPayload
,End
.