From f1b9e2faa9b88ec9de9ecef525ffc20efc5f186f Mon Sep 17 00:00:00 2001 From: "Victor \"multun\" Collod" Date: Tue, 21 May 2024 12:30:11 +0200 Subject: [PATCH] editoast: downgrade reqwest to mitigate timeout issues Somewhere between 0.11.27 and 0.12.3, a regression related to timeout handling was introduced. Other users seem to have similar issues: https://github.com/seanmonstar/reqwest/issues/2283 Interestingly enough, this bug report mentions http/2, but the server we're querying only supports http/1.1. --- editoast/Cargo.lock | 65 ++++++++++++++++++++++++--------------------- editoast/Cargo.toml | 3 ++- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/editoast/Cargo.lock b/editoast/Cargo.lock index f54aac0835b..e2fa9d308f7 100644 --- a/editoast/Cargo.lock +++ b/editoast/Cargo.lock @@ -77,7 +77,7 @@ dependencies = [ "encoding_rs", "flate2", "futures-core", - "h2 0.3.26", + "h2", "http 0.2.12", "httparse", "httpdate", @@ -698,7 +698,7 @@ dependencies = [ "derive_more", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "itoa", "log", @@ -1407,7 +1407,7 @@ dependencies = [ "rand 0.8.5", "rangemap", "redis", - "reqwest 0.12.4", + "reqwest 0.11.27", "rstest", "sentry", "sentry-actix", @@ -2005,25 +2005,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "h2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 1.1.0", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "half" version = "2.4.1" @@ -2174,7 +2155,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -2197,7 +2178,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.4", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -2220,6 +2200,19 @@ dependencies = [ "tokio-io-timeout", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.28", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "hyper-tls" version = "0.6.0" @@ -3818,23 +3811,27 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", "tokio", + "tokio-native-tls", "tower-service", "url", "wasm-bindgen", @@ -3851,16 +3848,14 @@ checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64 0.22.1", "bytes", - "encoding_rs", "futures-channel", "futures-core", "futures-util", - "h2 0.4.4", "http 1.1.0", "http-body 1.0.0", "http-body-util", "hyper 1.3.1", - "hyper-tls", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", @@ -3870,12 +3865,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile", + "rustls-pemfile 2.1.2", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -3989,6 +3983,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustls-pemfile" version = "2.1.2" @@ -4841,7 +4844,7 @@ dependencies = [ "axum", "base64 0.21.7", "bytes", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", diff --git a/editoast/Cargo.toml b/editoast/Cargo.toml index a80fde5ae4f..5540c77a7fb 100644 --- a/editoast/Cargo.toml +++ b/editoast/Cargo.toml @@ -94,7 +94,8 @@ redis = { version = "0.25.3", features = [ "tokio-comp", "tokio-native-tls-comp", ] } -reqwest = { version = "0.12.3", features = ["json"] } +# 0.12.0 to 0.12.4 have weird timeout issues https://github.com/seanmonstar/reqwest/issues/2283 +reqwest = { version = "0.11.27", features = ["json"] } sentry = "0.32.3" sentry-actix = "0.32.3" serde.workspace = true