-
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: prevent deadlock in transport Close when GoAway write hangs #7662
Conversation
…WhenGoAwayWriteHangs
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7662 +/- ##
==========================================
+ Coverage 81.89% 81.96% +0.06%
==========================================
Files 361 361
Lines 27818 27823 +5
==========================================
+ Hits 22782 22805 +23
+ Misses 3847 3833 -14
+ Partials 1189 1185 -4
|
Is there an existing issue filed which needs to be linked? |
@purnesh42H yes, added it in description. |
Some general comments here:
|
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 #7606.
Couple of recent changes worth noting here:
loopyWriter
to exit (after enqueueing the above GOAWAY frame on thecontrolbuf
). This was done to ensure that the client transport shutdown can complete in the face of a hanging network connection that blocks forever when attempting to write the above GOAWAY frameDescription of the deadlock:
controlbuf
,http2Client.Close
callshttp2Client.GetGoAwayReason
to fetch the last GOAWAY's debug message, and the latter attempts to grabhttp2Client.mu
.http2Client.outgoingGoAwayHandler
holdshttp2Client.mu
when it is attempting to write the GOAWAY frame. So, if the underlying network connection is hanging, this method will not release the mutex, and thereforehttp2Client.GetGoAwayReason
will not be able to grab the same mutex, and therebyhttp2Client.Close
will deadlock.RELEASE NOTES: