You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2018/07/24 22:15:14 UTC

hive git commit: HIVE-19935 : Hive WM session killed: Failed to update LLAP tasks count (Sergey Shelukhin, reviewed by Prasanth Jayachandran)

Repository: hive
Updated Branches:
  refs/heads/master 26f4d8ea4 -> 913081169


HIVE-19935 : Hive WM session killed: Failed to update LLAP tasks count (Sergey Shelukhin, reviewed by Prasanth Jayachandran)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/91308116
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/91308116
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/91308116

Branch: refs/heads/master
Commit: 913081169730e86969974023916df804d7b2a7e0
Parents: 26f4d8e
Author: sergey <se...@apache.org>
Authored: Tue Jul 24 15:15:05 2018 -0700
Committer: sergey <se...@apache.org>
Committed: Tue Jul 24 15:15:05 2018 -0700

----------------------------------------------------------------------
 .../hive/llap/tezplugins/LlapTaskSchedulerService.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/91308116/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
----------------------------------------------------------------------
diff --git a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
index 8217964..b748c7e 100644
--- a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
+++ b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
@@ -587,11 +587,14 @@ public class LlapTaskSchedulerService extends TaskScheduler {
     boolean newState = false;
     synchronized (ti) {
       assert ti.isPendingUpdate;
-      if (ti.lastSetGuaranteed != null && ti.lastSetGuaranteed == ti.isGuaranteed) {
+      if ((ti.lastSetGuaranteed != null && ti.lastSetGuaranteed == ti.isGuaranteed)
+          || ti.isGuaranteed == null) {
+        // Nothing to do - e.g. two messages have canceled each other before we could react,
+        // or the task was deallocated.
         ti.requestedValue = ti.isGuaranteed;
         setUpdateDoneUnderTiLock(ti);
         WM_LOG.info("Not sending update to " + ti.attemptId);
-        return; // Nothing to do - e.g. two messages have canceled each other before we could react.
+        return;
       }
       newState = ti.isGuaranteed;
     }
@@ -612,7 +615,8 @@ public class LlapTaskSchedulerService extends TaskScheduler {
   private void setUpdateDoneUnderTiLock(TaskInfo ti) {
     ti.isPendingUpdate = false;
     // It's ok to update metrics for two tasks in parallel, but not for the same one.
-    if (metrics != null) {
+    // Don't update metrics for the cancelled tasks - already taken care of during cancellation.
+    if (metrics != null && ti.requestedValue != null) {
       metrics.setWmPendingDone(ti.requestedValue);
     }
     ti.lastSetGuaranteed = ti.requestedValue;
@@ -660,7 +664,7 @@ public class LlapTaskSchedulerService extends TaskScheduler {
         // update the pending state for now as we release this lock to take both.
         newStateAnyTask = requestedValue;
       }
-    } // End of synchronized (ti) 
+    } // End of synchronized (ti)
     if (newStateSameTask != null) {
       WM_LOG.info("Sending update to the same task in response handling "
           + ti.attemptId + ", " + newStateSameTask);