@@ -17,10 +17,12 @@ use std::ops::Range;
1717use std:: path:: { Path , PathBuf } ;
1818use std:: pin:: Pin ;
1919use std:: task:: { Context , Poll } ;
20+ use std:: time:: Duration ;
2021use std:: { fmt, io} ;
2122
2223use anyhow:: { Context as AnyhhowContext , anyhow} ;
2324use async_trait:: async_trait;
25+ use aws_config:: timeout:: TimeoutConfig ;
2426use aws_credential_types:: provider:: SharedCredentialsProvider ;
2527use aws_sdk_s3:: Client as S3Client ;
2628use aws_sdk_s3:: config:: { Credentials , Region } ;
@@ -145,7 +147,14 @@ pub async fn create_s3_client(s3_storage_config: &S3StorageConfig) -> S3Client {
145147 s3_config. set_retry_config ( aws_config. retry_config ( ) . cloned ( ) ) ;
146148 s3_config. set_sleep_impl ( aws_config. sleep_impl ( ) ) ;
147149 s3_config. set_stalled_stream_protection ( aws_config. stalled_stream_protection ( ) ) ;
148- s3_config. set_timeout_config ( aws_config. timeout_config ( ) . cloned ( ) ) ;
150+ s3_config. set_timeout_config ( Some (
151+ TimeoutConfig :: builder ( )
152+ . connect_timeout ( Duration :: from_secs ( 5 ) )
153+ . read_timeout ( Duration :: from_secs ( 10 ) ) // Time to first byte
154+ . operation_attempt_timeout ( Duration :: from_secs ( 900 ) ) // Single attempt timeout
155+ . operation_timeout ( Duration :: from_secs ( 1800 ) ) // Total timeout
156+ . build ( ) ,
157+ ) ) ;
149158
150159 if let Some ( endpoint) = s3_storage_config. endpoint ( ) {
151160 info ! ( endpoint=%endpoint, "using S3 endpoint defined in storage config or environment variable" ) ;
0 commit comments