in emr-dynamodb-hadoop/src/main/java/org/apache/hadoop/dynamodb/DynamoDBFibonacciRetryer.java [93:121]
private void handleException(DateTime retryEndTime, Exception exception, Reporter reporter,
PrintCounter retryCounter) {
DateTime currentTime = new DateTime(DateTimeZone.UTC);
long maxDelay = retryEndTime.getMillis() - currentTime.getMillis();
if (verifyRetriableException(exception) && maxDelay > 0) {
if (exception instanceof AmazonServiceException) {
AmazonServiceException ase = (AmazonServiceException) exception;
if (throttleErrorCodes.contains(ase.getErrorCode())) {
// Retry exception
} else if (internalErrorStatusCodes.contains(ase.getStatusCode())) {
// Retry exception
} else {
throw new RuntimeException(exception);
}
}
incrementRetryCounter(reporter, retryCounter);
retryCount++;
log.warn("Retry: " + retryCount + " Exception: " + exception);
delayOp(maxDelay);
} else {
if (isShutdown) {
log.warn("Retries exceeded and caught, but is shutdown so not throwing", exception);
} else {
log.error("Retries exceeded or non-retryable exception, throwing: " + exception);
throw new RuntimeException(exception);
}
}
}