File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
main/java/software/amazon/awssdk/awscore/internal
test/java/software/amazon/awssdk/awscore/retry Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "category" : " Amazon EC2" ,
3
+ "type" : " feature" ,
4
+ "description" : " Adds EC2ThrottledException as a recognized throttling exception to be retried"
5
+ }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ public final class AwsErrorCode {
45
45
throttlingErrorCodes .add ("RequestThrottled" );
46
46
throttlingErrorCodes .add ("RequestThrottledException" );
47
47
throttlingErrorCodes .add ("LimitExceededException" );
48
+ throttlingErrorCodes .add ("EC2ThrottledException" );
48
49
THROTTLING_ERROR_CODES = unmodifiableSet (throttlingErrorCodes );
49
50
50
51
Set <String > definiteClockSkewErrorCodes = new HashSet <>(3 );
Original file line number Diff line number Diff line change @@ -102,6 +102,17 @@ public void doesNotRetryOnNonRetryableErrorCode() {
102
102
assertFalse (shouldRetry (applyErrorCode ("ValidationError" )));
103
103
}
104
104
105
+ @ Test
106
+ public void retriesOnEC2ThrottledException () {
107
+ AwsServiceException ex = AwsServiceException .builder ()
108
+ .awsErrorDetails (AwsErrorDetails .builder ()
109
+ .errorCode ("EC2ThrottledException" )
110
+ .build ())
111
+ .build ();
112
+
113
+ assertTrue (shouldRetry (b -> b .exception (ex )));
114
+ }
115
+
105
116
private boolean shouldRetry (Consumer <RetryPolicyContext .Builder > builder ) {
106
117
return defaultRetryCondition ().shouldRetry (RetryPolicyContext .builder ().applyMutation (builder ).build ());
107
118
}
You can’t perform that action at this time.
0 commit comments