From 89716e91ae563425a560156075bcb363943e556e Mon Sep 17 00:00:00 2001 From: Michael Burr Date: Thu, 5 Nov 2026 21:06:11 +0000 Subject: [PATCH] fix(upload): big S3 uploads on slow connections no longer fail after two minutes The whole request, sending included, had a 120 s deadline, so a 16 MiB PUT or an 8 MiB part that took longer always failed, retries and all. Now only the waits are limited: 30 s to connect and 120 s each for the response and its body, as pomf uploads already do. --- src/upload.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/upload.rs b/src/upload.rs index 5cce6b2..b8d739e 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -192,7 +192,11 @@ impl S3Target { fn agent() -> ureq::Agent { ureq::Agent::config_builder() .http_status_as_error(false) - .timeout_global(Some(Duration::from_secs(120))) + // Only the waits are limited, not the whole request: a big part + // on a slow connection can take many minutes to send. + .timeout_connect(Some(Duration::from_secs(30))) + .timeout_recv_response(Some(Duration::from_secs(120))) + .timeout_recv_body(Some(Duration::from_secs(120))) .build() .into() }