-
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
transport: Fix closing a closed channel panic in handlePing #5854
Conversation
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 modulo a couple nits. And also go/cl-descriptions style please.
I would also like to get a definitive root cause before we call this done, because it could be papering over another bug.
t.Fatalf("Failed to listen: %v", err) | ||
} | ||
defer lis.Close() | ||
s := grpc.NewServer() |
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 this needs to defer s.Stop()
just in case GracefulStop()
does hang (otherwise the leak detector hangs).
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.
Oh interesting added.
test/servertester.go
Outdated
@@ -273,3 +273,9 @@ func (st *serverTester) writeRSTStream(streamID uint32, code http2.ErrCode) { | |||
st.t.Fatalf("Error writing RST_STREAM: %v", err) | |||
} | |||
} | |||
|
|||
func (st *serverTester) writeGoAwayPing(ack bool, data [8]byte) { |
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.
writePing
? There's nothing about this ping that implies any relation to goaway besides the payload which is parameterized in data
.
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.
Oh lol fair point good catch. Changed.
Fixes #5786.
Two GoAway pings were previously closing a closed channel, this PR adds protection with respect to the drainChan closing (used as a signal to write second GoAway frame). We still to derive the underlying root cause as to why two goaway ping acks are being sent from the Swift client.
RELEASE NOTES: