From 765a4c0790789bba93abebacc2fcda849f087597 Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Wed, 21 Aug 2024 19:08:24 +0530 Subject: [PATCH 1/2] s3 client builder set the request time out to s3 client builder --- server/src/storage/s3.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/storage/s3.rs b/server/src/storage/s3.rs index 7eb24070f..5a87677ba 100644 --- a/server/src/storage/s3.rs +++ b/server/src/storage/s3.rs @@ -133,7 +133,8 @@ impl S3Config { fn get_default_builder(&self) -> AmazonS3Builder { let mut client_options = ClientOptions::default() .with_allow_http(true) - .with_connect_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS)); + .with_connect_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS)) + .with_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS)); if self.skip_tls { client_options = client_options.with_allow_invalid_certificates(true) From a414b17983b73554fc123094a9d5b4ca4acd2b3c Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Thu, 22 Aug 2024 20:06:47 +0530 Subject: [PATCH 2/2] added separate variable for request time out to 300 secs reverted connect time out to 5 secs --- server/src/storage/s3.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/storage/s3.rs b/server/src/storage/s3.rs index 5a87677ba..8f4b6a257 100644 --- a/server/src/storage/s3.rs +++ b/server/src/storage/s3.rs @@ -50,7 +50,8 @@ use super::{ #[allow(dead_code)] // in bytes const MULTIPART_UPLOAD_SIZE: usize = 1024 * 1024 * 100; -const CONNECT_TIMEOUT_SECS: u64 = 300; +const CONNECT_TIMEOUT_SECS: u64 = 5; +const REQUEST_TIMEOUT_SECS: u64 = 300; const AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: &str = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; #[derive(Debug, Clone, clap::Args)] @@ -134,7 +135,7 @@ impl S3Config { let mut client_options = ClientOptions::default() .with_allow_http(true) .with_connect_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS)) - .with_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS)); + .with_timeout(Duration::from_secs(REQUEST_TIMEOUT_SECS)); if self.skip_tls { client_options = client_options.with_allow_invalid_certificates(true)