Skip to content
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

v0.26 server example error: failed to serve connection: error shutting down connection #251

Closed
Vagelis-Prokopiou opened this issue Jan 14, 2024 · 2 comments

Comments

@Vagelis-Prokopiou
Copy link

Vagelis-Prokopiou commented Jan 14, 2024

Hello all. Thank you for all your hard work.

System:
Linux debian 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux

I am testing out the latest version server example before updating my application.
The "problem" is that for every request I get this in the console output:

failed to serve connection: error shutting down connection

Example requests:

curl -v -k https://127.0.0.1:1337
curl -v -k -d 'hello=world' https://127.0.0.1:1337/echo

Keep in mind that this behavior only happens with the curl requests. Not with the browser requests.

The only difference to the example is that I only enable HTTP 1/1 (but I don't think that this is related at all):

server_config.alpn_protocols = vec![b"http/1.1".to_vec()];

This is obviously coming from this part of the code:

if let Err(err) = Builder::new(TokioExecutor::new())
.serve_connection(TokioIo::new(tls_stream), service)
.await
{
    eprintln!("failed to serve connection: {err:#}");
}

All the requests are fulfilled ok (Status 200), so this error is kind of misleading. Should the closing of the connection be an error in itself?

I tried to debug it a little bit. to identify what exactly is going on, but I did not get to far. I noticed though that the non TLS hyper (v1) server does not produce this error (see latest https://github.com/hyperium/hyper/blob/master/examples/echo.rs).

So, to sum up:

  1. Is closing the connection really an error? If no, it should not bubble up and be reported as such.
  2. Where is this coming from? I suspect from hyper_rustls, since the non rustls hyper server does not have the same behavior.
@Gelbpunkt
Copy link
Contributor

I was running into this while testing #232 and decided not to look further into it because I was able to reproduce it on 0.25 as well. It seems to be a curl-specific bug, see this comment on the hyper issue related to the bug.

@cpu
Copy link
Member

cpu commented Jan 16, 2024

I think our position is still the one echoed in the linked comment and should be something addressed in Hyper. I'm going to close this issue for now but if the situation changes or someone disagrees we can revisit.

@cpu cpu closed this as completed Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants