-
Notifications
You must be signed in to change notification settings - Fork 4
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
Server cannot distinguish between clean and unclean client disconnect #209
Comments
A consequence of this problem is that even when the server tries to respond to the client (with trailers, say), it won't realize that the client has disappeared. After all, the client just indicated that they have no more data for the server, and the server doesn't realize something bad has happened; from the server's perspective, this looks like an entirely normal situation. This is even more reason to try and close the stream in a non-clean fashion. |
My suspicion (unverified):
-- We leave the inbound thread running. Although the channel is closed,
-- there might still be unprocessed messages in the queue. The inbound
-- thread will terminate once it reaches the end of the queue
If all this is correct:
|
Note: for this to be a reliable, there should not be any race conditions. The server should not first see the outbound STREAM closing (resulting in grapesy reporting |
We should verify in Wireshark the theory that the stream is only half-closed when the client leave the scope of |
Perhaps the cleanest way to solve this is to add an API to |
@FinleyMcIlwaine Once kazu-yamamoto/http2#142 and kazu-yamamoto/http-semantics#11 are merged, we can resolve this issue right? |
Closed in #211. |
Currently, when a client terminates with an exception, the HTTP stream is closed normally, which on the server side, if the handler is currently to read, will result in the handler seeing
NoMoreElems
rather thanClientDisconnected
.gRPC does not allow for client trailers, so unsure if we can fix this; perhaps we can terminate the HTTP stream in a different manner using a low-level HTTP2 feature.
We should verify what happens if the client is, say, a Python or C++ client.
Not sure if this is a bug or not; marking it as a
bug
for now, because telling the handler that the client signalledNoMoreElems
is wrong. However, not 100% sure if this bug is fixable (it might be a"bug in the gRPC spec" -- should have allowed for client trailers).The text was updated successfully, but these errors were encountered: