-
Notifications
You must be signed in to change notification settings - Fork 4.5k
internal/transport: Wait for server goroutines to exit during shutdown in test #8306
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8306 +/- ##
========================================
Coverage 82.14% 82.14%
========================================
Files 417 419 +2
Lines 41344 42034 +690
========================================
+ Hits 33961 34529 +568
- Misses 5957 6031 +74
- Partials 1426 1474 +48 🚀 New features to boost your workflow:
|
internal/transport/transport_test.go
Outdated
}) | ||
go func() { | ||
transport.HandleStreams(ctx, func(s *ServerStream) { | ||
go h.handleStreamMisbehave(t, s) |
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.
Should this (and similar) be outside the other goroutine now? Or does HandleStreams
track this and not return until all streams it's handling are 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.
I don't think HandleStreams
has any way of tracking if a stream handler has completed. The internal race detector didn't report any failures after the change to wait for HandleStreams
to return. This could be because nothing is logged after HandleStreams
returns, so no accesses to GRPCLogger
. Anyways, I've added to the WaitGroup every time a go routine is spawned.
Internal bug: b/416700146
Presently the PingPong tests don't wait for server goroutines to finish work before the return. This causes data races when the next test tries to update the GRPCLogger. Closing the server isn't sufficient.
grpc-go/internal/transport/http2_server.go
Lines 1265 to 1268 in 950a7cf
RELEASE NOTES: N/A