Closed haydnv closed 3 months ago
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.
Got it, thanks!
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)
, whereio
is ahyper_util::TokioIo
wrapping atokio::net::TcpStream
andservice
is constructed withhyper::service::service_fn
. Here is a minimal reproducible example: https://gist.github.com/haydnv/9ed45169963a61c8a18aca341b3b3044I 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.