You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use compio::time::sleep;use cyper::Client;use http::Version;use std::time::Duration;#[compio::main]asyncfnmain(){let client = Client::new();println!("Send request 1");let response = client
.get("https://example.com/").unwrap().version(Version::HTTP_2).send().await.unwrap();println!("Request 1 done, sleeping");sleep(Duration::from_secs(180)).await;println!("Send request 2");
client
.get("https://example.com/").unwrap().version(Version::HTTP_2).send().await.unwrap();println!("Now check your CPU usage");loop{sleep(Duration::from_secs(600)).await;}}
Debugger shows that the task is being woken up unconditionally in h2's Connection::poll without any scheduling. Initial investigation might indicate the following issues:
The shutdown op in cyper (or compio) never finishes in this scenario, and/or
The h2 crate never considers a runtime where shutdown does not return Poll::Ready immediately, leading to a flawed poll implementation.
The text was updated successfully, but these errors were encountered:
h2 has fixed the infinite waking up in hyperium/h2#834, but the issue of connections not shutting down properly seems still persist.
Sharing some logs when debugging my bot program with h2=trace here: https://pastebin.com/43Npck46. There are 16 connection.state transitions, where 4 of them are Closing while all the remaining are Open. By right the Closing states should be followed by Closed shortly after poll_shutdown being done.
Now that h2 has fixed this: hyperium/h2#836, I guess we only need to wait for a new h2 release and bump our dependency version requirement (maybe in compio-io?).
Code to reproduce:
Debugger shows that the task is being woken up unconditionally in h2's Connection::poll without any scheduling. Initial investigation might indicate the following issues:
Poll::Ready
immediately, leading to a flawedpoll
implementation.The text was updated successfully, but these errors were encountered: