@@ -54,6 +54,8 @@ public class AWSClientFactory implements Serializable {
5454 static final String AWS_DEFAULT_REGION = "AWS_DEFAULT_REGION" ;
5555 static final String AWS_REGION = "AWS_REGION" ;
5656 static final String AWS_ENDPOINT_URL = "AWS_ENDPOINT_URL" ;
57+ static final String AWS_SDK_SOCKET_TIMEOUT = "AWS_SDK_SOCKET_TIMEOUT" ;
58+ static final String AWS_SDK_RETRIES = "AWS_SDK_RETRIES" ;
5759 static final String AWS_PIPELINE_STEPS_FROM_NODE = "AWS_PIPELINE_STEPS_FROM_NODE" ;
5860 private static AWSClientFactoryDelegate factoryDelegate ;
5961
@@ -102,8 +104,15 @@ public static <B extends AwsSyncClientBuilder<?, T>, T> T create(B clientBuilder
102104
103105 private static ClientConfiguration getClientConfiguration (EnvVars vars ) {
104106 ClientConfiguration clientConfiguration = new ClientConfiguration ();
105- //the default max retry is 3. Increasing this to be more resilient to upstream errors
106- clientConfiguration .setRetryPolicy (new RetryPolicy (null , null , 10 , false ));
107+
108+ // The default SDK max retry is 3, increasing this to be more resilient to upstream errors
109+ Integer retries = Integer .valueOf (vars .get (AWS_SDK_RETRIES , "10" ));
110+ clientConfiguration .setRetryPolicy (new RetryPolicy (null , null , retries , false ));
111+
112+ // The default SDK socket timeout is 50000, use as deafult and allow to override via environment variable
113+ Integer socketTimeout = Integer .valueOf (vars .get (AWS_SDK_SOCKET_TIMEOUT , "50000" ));
114+ clientConfiguration .setSocketTimeout (socketTimeout );
115+
107116 ProxyConfiguration .configure (vars , clientConfiguration );
108117 return clientConfiguration ;
109118 }
0 commit comments