-
Notifications
You must be signed in to change notification settings - Fork 22
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
Bug in syncWithSender
(?)
#151
Comments
Fixed. |
If this happens with v5.3.5 but does not happen with v5.3.4, this is due to the removal of |
See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
@kazu-yamamoto I can confirm that this happens with both 5.3.4 and 5.3.5, but not with |
Thanks. |
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The problem is fixed in latest `http2` (`7036a3429fb08bfcd5947230c37d1f3e63dfb3a6`). See kazu-yamamoto/http2#151 for the `http2` bug report. Closes #257.
The initial symptom I noticed was that my test suite would sometimes fail with
I managed to construct an example (through
grapesy
) that would reliably reproduce this; in this example, the server handler terminates immediately, sends a response to the client, and the client receives that response without ever sending any data of its own. An unusual situation but one that can arise if the handler would throw an exception (which in gRPC is sent as a regular response to the client). Curiously, a minor variation on this same test where the client first sends one message to the server did not result in the same socket leak. (Note that both the server and the client use streaming bodies.)Debugging this took me into quite a deep rabbit hole.
The call to
accept
happens inrunTCPServerWithSocket
innetwork-run
. This closes the socket when the specified server terminates; conclusion: the server wasn't terminating.The server in question in this case is
Network.HTTP2.Server.Run.runH2
inhttp2
. It terminates when its background threads terminate, and in particular, when the frame receiver terminates. The frame receiver terminates in one of two conditions:GOAWAY
message.confReadN
returns anull
resultFor reasons I don't yet fully understand, in my test case where the client does at least send one message (that is, part of a streaming output), a
GOAWAY
message was sent, but in the case where the server handler terminates without the client sending anything, this did not happen. That by itself should not be a problem; after all, the client terminates the connection and so the socket should be closed. Conclusion: it wasn't the server not properly closing the socket, it was the client.The client socket is created in
runTCPClientWithSettings
, again innetwork-run
. As on the server side, this socket is closed after the client terminates; conclusion: the client wasn't terminating.The client in question in this case is
Network.HTTP2.Client.Run.runH2
inhttp2
.I tracked this down to
wrapClinet
(presumably a typo forwrapClient
?). In particular, it was the call towaitCounter0
on the thread manager that was blocking indefinitely. Conclusion: some managed thread was not terminating.For this particular example, two managed threads were created in the client:
H2 streaming supporter for stream 1
andH2 worker
; I saw a call todecCounter
for the former, but not for the latter.The
H2 worker
thread is spawned insendHeaderBody
inNetwork.HTTP2.Client.Run
, and runssyncWithSender
.At this point I am not sure how to continue debugging this, or whether I should propose a fix. Perhaps the solution needs to be that somehow
closeAllStreams
must be able to indicate to theH2 worker
thread that it is no longer required? I don't fully understand what all thisSync
stuff is for, and moreover it looks like #148 will change some of it, although I'm not sure if that will affect this. So I'm opening this ticket instead of proposing a PR; please let me know how you'd like to continue or what you'd like me to do.The text was updated successfully, but these errors were encountered: