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

RoutingDsl::or causes HTTP/2 requests to hang #191

Closed
programatik29 opened this issue Aug 16, 2021 · 2 comments · Fixed by #199
Closed

RoutingDsl::or causes HTTP/2 requests to hang #191

programatik29 opened this issue Aug 16, 2021 · 2 comments · Fixed by #199
Labels
C-bug Category: This is a bug. S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work.
Milestone

Comments

@programatik29
Copy link
Contributor

Bug Report

Version

#108 and after.

Platform

Linux 4.19.0-17-amd64 #1 SMP Debian 4.19.194-1 (2021-06-10) x86_64 GNU/Linux

Crates

dev-dependencies in Cargo.toml

Description

When running tls example any request to non-matching route cause hanging when using http2 protocol.

I ran tls example using cargo run --example tls_rustls.

Then I ran curl -k https://localhost:3000/asdasd in a separate tab. That did not return as expected.

After last command, I ran curl -k --http1.1 https://localhost:3000/asdasd. That returned nothing(404 status code) as expected.

@davidpdrsn davidpdrsn added this to the 0.2 milestone Aug 16, 2021
@davidpdrsn davidpdrsn added the C-bug Category: This is a bug. label Aug 16, 2021
@davidpdrsn
Copy link
Member

This can be reproduced without axum using just hyper:

use http::{Request, Response};
use hyper::Body;
use std::convert::Infallible;

#[tokio::main]
async fn main() {
    let svc = tower::service_fn(|req: Request<Body>| async move {
        let mut res = Response::new(Body::empty());
        let body = req.into_body();
        res.extensions_mut().insert(body);
        Ok::<_, Infallible>(res)
    });

    hyper::Server::bind(&"127.0.0.1:3000".parse().unwrap())
        .serve(tower::make::Shared::new(svc))
        .await
        .unwrap();
}

curl -v localhost:3000 --http2-prior-knowledge fails but curl -v localhost:3000 works.

@davidpdrsn
Copy link
Member

I've filed hyperium/hyper#2621

@davidpdrsn davidpdrsn added the S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work. label Aug 17, 2021
@davidpdrsn davidpdrsn changed the title http2 hang bug RoutingDsl::or causes HTTP/2 requests to hang Aug 17, 2021
davidpdrsn added a commit that referenced this issue Aug 17, 2021
This is a nasty hack that works around
hyperium/hyper#2621.

Fixes #191
davidpdrsn added a commit that referenced this issue Aug 17, 2021
This is a nasty hack that works around
hyperium/hyper#2621.

Fixes #191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants