HADOOP-14966. Handle JDK-8071638 for hadoop-common. Contributed by Bibin A Chundatt.
(cherry picked from commit 6b8122458e
)
This commit is contained in:
parent
a373094bf9
commit
2b04ae918c
|
@ -40,14 +40,16 @@ public final class ExecutorHelper {
|
|||
|
||||
//For additional information, see: https://docs.oracle
|
||||
// .com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor
|
||||
// .html#afterExecute(java.lang.Runnable,%20java.lang.Throwable) .
|
||||
// .html#afterExecute(java.lang.Runnable,%20java.lang.Throwable)
|
||||
|
||||
if (t == null && r instanceof Future<?>) {
|
||||
// Handle JDK-8071638
|
||||
if (t == null && r instanceof Future<?> && ((Future<?>) r).isDone()) {
|
||||
try {
|
||||
((Future<?>) r).get();
|
||||
} catch (ExecutionException ee) {
|
||||
LOG.warn("Execution exception when running task in " +
|
||||
Thread.currentThread().getName());
|
||||
LOG.warn(
|
||||
"Execution exception when running task in " + Thread.currentThread()
|
||||
.getName());
|
||||
t = ee.getCause();
|
||||
} catch (InterruptedException ie) {
|
||||
LOG.warn("Thread (" + Thread.currentThread() + ") interrupted: ", ie);
|
||||
|
|
Loading…
Reference in New Issue