Skip to content

Commit

Permalink
feat(rt): retry certain HTTP errors (SRA)
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Apr 19, 2023
1 parent 03d9506 commit 2b9cd15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changes/68fbe8a4-1cc2-4f47-b219-60ef0d377f20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "68fbe8a4-1cc2-4f47-b219-60ef0d377f20",
"type": "feature",
"description": "BREAKING: Add support for retrying certain transient HTTP errors. `RetryErrorType.Timeout` was renamed to `RetryErrorType.Transient`."
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public object AwsDefaultRetryPolicy : StandardRetryPolicy() {
internal val knownErrorTypes = mapOf(
"BandwidthLimitExceeded" to Throttling,
"EC2ThrottledException" to Throttling,
"IDPCommunicationError" to Timeout,
"IDPCommunicationError" to Transient,
"LimitExceededException" to Throttling,
"PriorRequestNotComplete" to Throttling,
"ProvisionedThroughputExceededException" to Throttling,
"RequestLimitExceeded" to Throttling,
"RequestThrottled" to Throttling,
"RequestThrottledException" to Throttling,
"RequestTimeout" to Timeout,
"RequestTimeoutException" to Timeout,
"RequestTimeout" to Transient,
"RequestTimeoutException" to Transient,
"SlowDown" to Throttling,
"ThrottledException" to Throttling,
"Throttling" to Throttling,
Expand All @@ -34,10 +34,10 @@ public object AwsDefaultRetryPolicy : StandardRetryPolicy() {
)

internal val knownStatusCodes = mapOf(
500 to Timeout,
502 to Timeout,
503 to Timeout,
504 to Timeout,
500 to Transient,
502 to Transient,
503 to Transient,
504 to Transient,
)

override fun evaluateSpecificExceptions(ex: Throwable): RetryDirective? = when (ex) {
Expand Down

0 comments on commit 2b9cd15

Please sign in to comment.