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

Hyper server hangs when handling a request from a client on the same host (not necessarily the same process) #3611

Closed
haydnv opened this issue Mar 26, 2024 · 2 comments

Comments

@haydnv
Copy link

haydnv commented Mar 26, 2024

Version
hyper 1.2
futures 0.3
http_body_util 0.1
hyper_util 0.1
tokio 1.36 with the macros, net, and rt-multi-thread features

Platform
Linux x86_64

Description
A Hyper server task hangs at http1::Builder::new().serve_connection(io, service), where io is a hyper_util::TokioIo wrapping a tokio::net::TcpStream and service is constructed with hyper::service::service_fn. Here is a minimal reproducible example: https://gist.github.com/haydnv/9ed45169963a61c8a18aca341b3b3044

I expect that the test client will receive a "Hello, World!" response from the test server exactly once, but what actually happens is that the server task hangs at http1::Builder::serve_connection. Let me know if I can provide any more information to help debug this issue.

@haydnv haydnv added the C-bug Category: bug. Something is wrong. This is bad! label Mar 26, 2024
@seanmonstar seanmonstar removed the C-bug Category: bug. Something is wrong. This is bad! label Mar 26, 2024
@seanmonstar
Copy link
Member

The hang comes from L86. You're awaiting the client connection, and trying to send a request after that. When the client connection future completes, that means the connection is closed. You usually want to spawn the connection into a new task.

@seanmonstar seanmonstar closed this as not planned Won't fix, can't repro, duplicate, stale Mar 26, 2024
@haydnv
Copy link
Author

haydnv commented Mar 27, 2024

Got it, thanks!

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

2 participants