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
The code is as followings. stream.binance.com is blocked in China. The thing is that there is no timeout by default, and the program just stay here forever trying to reconnect.
use tracing_log::LogTracer;use tracing_subscriber::fmt;use tracing_subscriber::fmt::format::FmtSpan;use tracing::Level;pubfnsetup_logs(log_level:Level) -> std::io::Result<()>{LogTracer::init().expect("Cannot setup_logs");let subscriber = fmt().with_max_level(log_level).with_thread_names(true).with_span_events(FmtSpan::CLOSE).finish();
tracing::subscriber::set_global_default(subscriber).expect("Cannot setup_logs");Ok(())}#[tokio::main]asyncfnmain() -> anyhow::Result<()>{setup_logs(Level::TRACE);let x = reqwest::get("https://stream.binance.com").await?.text().await?;println!("Result {}", x);Ok(())}
Apr 25 21:54:26.492 TRACE main hyper::client::pool: checkout waiting for idle connection: ("https", stream.binance.com)
Apr 25 21:54:26.492 DEBUG main reqwest::connect: starting new connection: https://stream.binance.com/
Apr 25 21:54:26.492 TRACE main hyper::client::connect::http: Http::connect; scheme=Some("https"), host=Some("stream.binance.com"), port=None
Apr 25 21:54:26.492 DEBUG tokio-runtime-worker hyper::client::connect::dns: resolving host="stream.binance.com"
Apr 25 21:54:26.498 DEBUG main hyper::client::connect::http: connecting to 45.114.11.238:443
Apr 25 21:54:26.498 TRACE main mio::poll: registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
Apr 25 21:54:26.800 DEBUG main hyper::client::connect::http: connecting to [2001::1f0d:5036]:443
Apr 25 21:54:26.800 TRACE main hyper::client::connect::http: connect error for [2001::1f0d:5036]:443: ConnectError("tcp connect error", Os { code: 101, kind: Other, message: "Network is unreachable" })
My debugger can only trace to hyper-0.14.5/src/client/client.rs:227.
asyncfn send_request(&self,mutreq:Request<B>,pool_key:PoolKey,) -> Result<Response<Body>,ClientError<B>>{227:letmut pooled = self.connection_for(pool_key).await?;
Maybe it's because retryably_send_request does not have a retry limit
The text was updated successfully, but these errors were encountered:
@qiujiangkun possibly running into the same problem. Did you ever find the root cause and/or find a way to fix it? Was it actually the missing retry limit?
The code is as followings.
stream.binance.com
is blocked in China. The thing is that there is no timeout by default, and the program just stay here forever trying to reconnect.My debugger can only trace to
hyper-0.14.5/src/client/client.rs:227
.Maybe it's because
retryably_send_request
does not have a retry limitThe text was updated successfully, but these errors were encountered: