YARN-3155. Refactor the exception handling code for TimelineClientImpl's retryOn method (Li Lu via wangda)
This commit is contained in:
parent
af08425893
commit
00a748d24a
|
@ -255,6 +255,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
YARN-3144. Configuration for making delegation token failures to timeline
|
YARN-3144. Configuration for making delegation token failures to timeline
|
||||||
server not-fatal (Jonathan Eagles via jlowe)
|
server not-fatal (Jonathan Eagles via jlowe)
|
||||||
|
|
||||||
|
YARN-3155. Refactor the exception handling code for TimelineClientImpl's
|
||||||
|
retryOn method (Li Lu via wangda)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
YARN-2990. FairScheduler's delay-scheduling always waits for node-local and
|
YARN-2990. FairScheduler's delay-scheduling always waits for node-local and
|
||||||
|
|
|
@ -178,20 +178,7 @@ public class TimelineClientImpl extends TimelineClient {
|
||||||
try {
|
try {
|
||||||
// try perform the op, if fail, keep retrying
|
// try perform the op, if fail, keep retrying
|
||||||
return op.run();
|
return op.run();
|
||||||
} catch (IOException e) {
|
} catch (IOException | RuntimeException e) {
|
||||||
// We may only throw runtime and IO exceptions. After switching to
|
|
||||||
// Java 1.7, we can merge these two catch blocks into one.
|
|
||||||
|
|
||||||
// break if there's no retries left
|
|
||||||
if (leftRetries == 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (op.shouldRetryOn(e)) {
|
|
||||||
logException(e, leftRetries);
|
|
||||||
} else {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
// break if there's no retries left
|
// break if there's no retries left
|
||||||
if (leftRetries == 0) {
|
if (leftRetries == 0) {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue