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

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

Closed
gituser-rs opened this issue May 5, 2024 · 2 comments
Labels
A-docs Area: documentation. E-easy Effort: easy. A task that would be a great starting point for a new contributor.

Comments

@gituser-rs
Copy link

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 gituser-rs added the C-bug Category: bug. Something is wrong. This is bad! label May 5, 2024
@seanmonstar
Copy link
Member

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 seanmonstar changed the title wrong error handling in service Documentation for Service::Error behavior should say it is protocol dependent May 6, 2024
@seanmonstar seanmonstar added E-easy Effort: easy. A task that would be a great starting point for a new contributor. A-docs Area: documentation. and removed C-bug Category: bug. Something is wrong. This is bad! labels May 6, 2024
yinheli added a commit to yinheli/hyper that referenced this issue Jul 22, 2024
…um#3659)

The Service trait now includes a note about the behavior of returning an Error to a hyper server, which can cause the connection to be abruptly aborted depending on the protocol. This information is important for developers working with hyper servers.
yinheli added a commit to yinheli/hyper that referenced this issue Jul 22, 2024
…m#3659)

The Service trait now includes a note about the behavior of returning an Error to a hyper server, which can cause the connection to be abruptly aborted depending on the protocol. This information is important for developers working with hyper servers.
yinheli added a commit to yinheli/hyper that referenced this issue Jul 23, 2024
…m#3659)

The Service trait now includes a note about the behavior of returning an Error to a hyper server, which can cause the connection to be abruptly aborted depending on the protocol. This information is important for developers working with hyper servers.
seanmonstar pushed a commit that referenced this issue Jul 23, 2024
…#3712)

The Service trait now includes a note about the behavior of returning an Error to a hyper server, which can cause the connection to be abruptly aborted depending on the protocol. This information is important for developers working with hyper servers.
@seanmonstar
Copy link
Member

Closed by #3712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation. E-easy Effort: easy. A task that would be a great starting point for a new contributor.
Projects
None yet
Development

No branches or pull requests

2 participants