Skip to content

Commit 1149cae

Browse files
committed
fix: rename timeout constant and increase to 5 minutes and set connect_timeout
1 parent cb8fb0a commit 1149cae

File tree

1 file changed

+6
-3
lines changed
  • aggregation_mode/src/backend

1 file changed

+6
-3
lines changed

aggregation_mode/src/backend/s3.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ const RETRY_MAX_TIMES: usize = 5;
2626
/// Maximum delay between retry attempts (in seconds)
2727
const RETRY_MAX_DELAY_SECONDS: u64 = 10;
2828

29-
/// Timeout for Reqwest Client
30-
const REQWEST_TIMEOUT_SECONDS: Duration = Duration::from_secs(60);
29+
/// Timeout for establishing a connection to S3
30+
const CONNECT_TIMEOUT_SECONDS: Duration = Duration::from_secs(10);
31+
/// Timeout for Batch Download Requests
32+
const BATCH_DOWNLOAD_TIMEOUT_SECONDS: Duration = Duration::from_secs(5 * 60);
3133

3234
async fn get_aligned_batch_from_s3_retryable(
3335
url: String,
3436
) -> Result<Vec<VerificationData>, RetryError<GetBatchProofsError>> {
3537
info!("Fetching batch from S3 URL: {}", url);
3638
let client = reqwest::Client::builder()
3739
.user_agent(DEFAULT_USER_AGENT)
38-
.timeout(REQWEST_TIMEOUT_SECONDS)
40+
.connect_timeout(CONNECT_TIMEOUT_SECONDS)
41+
.timeout(BATCH_DOWNLOAD_TIMEOUT_SECONDS)
3942
.build()
4043
.map_err(|e| RetryError::Permanent(GetBatchProofsError::ReqwestClientFailed(e.to_string())))?;
4144

0 commit comments

Comments
 (0)