ntex-rs / ntex

framework for composable networking services
Apache License 2.0
1.84k stars 105 forks source link

http client closes h2 connection #349

Closed khvzak closed 1 month ago

khvzak commented 1 month ago

code:

#[ntex::main]
async fn main() -> Result<(), ()> {
    tracing_subscriber::fmt::init();
    let client = ntex::http::client::Client::new();
    loop {
        let _response = client.get("https://www.google.com").send().await.unwrap();
        ntex::time::sleep(std::time::Duration::from_secs(10)).await;
    }
}

latest ntex and all dependencies, tokio runtime + openssl

prints:

2024-04-30T13:34:29.404124Z DEBUG ntex_h2::connection: Sending local settings Settings { flags: (0x0), enable_push: 0, max_concurrent_streams: 256, max_header_list_size: 49152 }
2024-04-30T13:34:29.404267Z DEBUG ntex_h2::connection: Sending connection window update to 983041
2024-04-30T13:34:29.404571Z DEBUG ntex_h2::connection: start http client ping/pong task
...
2024-04-30T13:34:29.798287Z DEBUG ntex_h2::dispatcher: Handle h2 message: DispatchItem::Item(Ping { ack: false, payload: [0, 0, 0, 0, 0, 0, 1, 236] })
2024-04-30T13:34:31.646644Z DEBUG ntex_io::ioref: TCP-CLIENT: Stop timer
2024-04-30T13:34:31.646732Z DEBUG ntex_h2::dispatcher: Handle h2 message: DispatchItem::KeepAliveTimeout
2024-04-30T13:34:31.646768Z  WARN ntex_h2::dispatcher: did not receive pong response in time, closing connection

It happenes after updating ntex-h2 to 0.5.3+.

fafhrd91 commented 1 month ago

ntex-h2 0.5.5 is released, should fix the bug