From 6835056be9659e697b55e2e23b6f2b6a7a84cd52 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Thu, 29 Oct 2026 22:41:59 +0100 Subject: [PATCH] fix(download): drop the total request timeout from transfers The 300 s client timeout covered the whole body stream, so any download slower than a couple of MB/s died mid-transfer. Connect and per-read windows catch dead peers and stalls instead; slow transfers now finish. --- crates/ecrou/src/download.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/ecrou/src/download.rs b/crates/ecrou/src/download.rs index 795ab71..0d8578b 100644 --- a/crates/ecrou/src/download.rs +++ b/crates/ecrou/src/download.rs @@ -268,8 +268,12 @@ async fn download_file_async( ) -> anyhow::Result<()> { log::debug!("Downloading: {}", url); + // No total timeout: a slow transfer of any size must finish. The + // connect window and the per-read window catch dead peers and + // stalled streams instead. let client = Client::builder() - .timeout(Duration::from_secs(300)) + .connect_timeout(Duration::from_secs(30)) + .read_timeout(Duration::from_secs(60)) .build() .context("Failed to create HTTP client")?; @@ -349,8 +353,12 @@ async fn download_oci_image_async( dest: &Path, progress: &dyn Progress, ) -> anyhow::Result<()> { + // No total timeout: a slow transfer of any size must finish. The + // connect window and the per-read window catch dead peers and + // stalled streams instead. let client = Client::builder() - .timeout(Duration::from_secs(300)) + .connect_timeout(Duration::from_secs(30)) + .read_timeout(Duration::from_secs(60)) .build() .context("Failed to create HTTP client")?;