hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Documentation for Service::Error behavior should say it is protocol dependent

Open gituser-rs opened this issue 1 year ago • 1 comments

Version 1.3.1

Platform Ubuntu 23.10

Description I am using hyper-util auto server. I return an error from service. Instead of sending GOAWAY and closing connection hyper sends RST_STREAM. I looked into documentation and it looks like the connection should closed, but it sends RST.

image

let mut builder = Builder::new(TokioExecutor::new());;

.............

let service = service_fn(move |request| {
 async move {
   println!("request");

   Err::<Response<String>, &str>("error")
 }
}

if let Err(err) = builder.serve_connection(stream, service).await {
    println!("{err}")
}

gituser-rs avatar May 05 '24 18:05 gituser-rs

Ah ok, yea, that's a problem with the docs. They should be updated to say that the behavior depends on the protocol version. It will abort the request however the protocol allows, either with some sort of RST_STREAM, or killing the connection if that doesn't exist.

seanmonstar avatar May 06 '24 13:05 seanmonstar

Closed by #3712

seanmonstar avatar Aug 30 '24 11:08 seanmonstar