diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java index 5dc62828d3c..9476220c69f 100644 --- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java +++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java @@ -380,9 +380,16 @@ public void killTask() { // If the task hasn't started - inform about fragment completion immediately. It's possible for // the callable to never run. fragmentCompletionHanler.fragmentComplete(fragmentInfo); - this.amReporter - .unregisterTask(request.getAmHost(), request.getAmPort(), - fragmentInfo.getQueryInfo().getQueryIdentifier(), ta); + + try { + this.amReporter + .unregisterTask(request.getAmHost(), request.getAmPort(), + fragmentInfo.getQueryInfo().getQueryIdentifier(), ta); + } catch (Throwable thr) { + // unregisterTask can throw a RuntimeException (i.e. if task attempt not found) + // this brings down LLAP daemon if exception is not caught here + LOG.error("Unregistering task from AMReporter failed", thr); + } } } } else {