Skip to content

Commit

Permalink
Retry Refinements
Browse files Browse the repository at this point in the history
- Update readme, including version of update
- Add 2 additional plausible retriable 400 issue's
  • Loading branch information
spangaer committed Oct 17, 2024
1 parent 49f3337 commit a1fb159
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Changing this number changes both the number of concurrent connections and the u

## Retry behavior

This plugin uses exponential backoff when 50X errors from DynamoDB would occur. This includes network glitches and provisioned throughput exceptions (request rate is too high).
This plugin uses exponential backoff when plausible and retriable errors from DynamoDB occur. This includes network glitches (50x; since Pekko 1.1.0) and throughput exceptions (400; extended in Pekko 1.1.0).

The backoff strategy is very simple.
- There are a maximum of 10 retries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,23 @@ private class RetryStateHolder(var retries: Int = 10, var backoff: FiniteDuratio
object DynamoRetriableException {
def unapply(ex: AmazonServiceException) = {
ex match {
case _: ProvisionedThroughputExceededException =>
Some(ex)
// 50x network glitches
case _: InternalServerErrorException =>
Some(ex)
case ase if ase.getStatusCode >= 502 && ase.getStatusCode <= 504 =>
// retry on more common server errors
Some(ex)

// 400 throughput issues
case _: ProvisionedThroughputExceededException =>
Some(ex)
case _: RequestLimitExceededException =>
// rate of on-demand requests exceeds the allowed account throughput
// and the table cannot be scaled further
Some(ex)
case ase if ase.getErrorCode == "ThrottlingException" =>
// // rate of AWS requests exceeds the allowed throughput
Some(ex)
case _ =>
None
}
Expand Down

0 comments on commit a1fb159

Please sign in to comment.