Stop RetryDriver when interrupted
Stop attempting retries in Hive's RetryDriver if an InterruptedException
is caught or when the current thread is interrupted and immediately throw
the current exception. Otherwise, RetryDriver might interfere with drivers
terminating in a timely manner after tasks are terminated via a
cancel, failure, or abort.
@@ -139,6 +139,11 @@ public class RetryDriver
return callable.call();
}
catch (Exception e) {
+ // Immediately stop retry attempts once an interrupt has been received
+ if (e instanceof InterruptedException || Thread.currentThread().isInterrupted()) {
+ addSuppressed(e, suppressedExceptions);
+ throw e;
+ }
e = exceptionMapper.apply(e);
for (Class<? extends Exception> clazz : exceptionWhiteList) {
if (clazz.isInstance(e)) {
