BATCH-1717: catch and rethrow to protect against retry infinite loop

This commit is contained in:
Dave Syer
2011-03-21 09:26:48 +00:00
parent eb79b4c2fb
commit aeadf8b02e
2 changed files with 5 additions and 1 deletions

View File

@@ -245,7 +245,11 @@ public class RetryTemplate implements RetryOperations {
doOnErrorInterceptors(retryCallback, context, e);
registerThrowable(retryPolicy, state, context, e);
try {
registerThrowable(retryPolicy, state, context, e);
} catch (Exception ex) {
throw new TerminatedRetryException("Terminated retry after error in policy", ex);
}
if (canRetry(retryPolicy, context) && !context.isExhaustedOnly()) {
try {