-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
http2 connections on localhost produce 'connection error: not connected' error on client close #3070
Comments
Seems likely that the kernel is able to wrap up the shutdown near instantly when it is localhost, and so the error makes sense. It's not something I would expect hyper to silently swallow, so if you don't want it appearing in your reporting, you'll need to filter it yourself. |
if it is not an error, why does hyper throw an error then? is there no way for hyper to decide if it is a valid error or not? |
I didn't say it's not an error, I said it makes sense (the error code is ENOTCONN). The connection likely is closed very quickly, so the operating system says it is "not connected". It doesn't mean something catastrophic happened, you need to compare what the error means with the context of how it happened, and then decide if that is a big deal for your application, or something to ignore. hyper can't decide that for you. |
ok i get what you're saying, but it's still not clear to me how we should determine if the error is valid or not since we don't have any additional context from hyper aside from the error. basically a client connects and it should not be an error when the client disconnects normally. the question is how we can detect such a case (e.g. maybe you can give an example with my code examples from above?) or asked differently, under what circumstances could such an ENOTCONN error happen (aside from the observed way here) |
It doesn't actually make sense to me. Unless data needs to be sent, a closed socket shouldn't produce an Unless the send futures get documented this way? But then every user would have to perform this test, which would duplicate the same piece of code for every user of the library :S |
Version
from Cargo.toml
from
cargo tree
Platform
Description
Closing a HTTP2 connection from the client side that resides on the same host (localhost/127.0.0.1),
the server sometimes gets an error:
'connection error: not connected'
This never happens (AFAICT) when having the server on a different host than the client
I tried this code (most copied from the hyper/h2 examples)
server:
client:
Letting the server run, and using the client in a loop, i get here ~50%
How can we gracefully close the connection from the client without getting those errors?
The text was updated successfully, but these errors were encountered: