tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bi...@apache.org
Subject git commit: TEZ-204. Can't Kill job started by tez-mapred-example jar (bikas)
Date Mon, 10 Jun 2013 23:27:38 GMT
Updated Branches:
  refs/heads/master 93e6fc605 -> 063b566ae


TEZ-204. Can't Kill job started by tez-mapred-example jar (bikas)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/063b566a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/063b566a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/063b566a

Branch: refs/heads/master
Commit: 063b566aee68e4fc5fbef99263d5997b1041c5ae
Parents: 93e6fc6
Author: Bikas Saha <bikas@apache.org>
Authored: Mon Jun 10 16:22:02 2013 -0700
Committer: Bikas Saha <bikas@apache.org>
Committed: Mon Jun 10 16:22:02 2013 -0700

----------------------------------------------------------------------
 .../org/apache/tez/mapreduce/YARNRunner.java    | 30 ++------------------
 1 file changed, 2 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/063b566a/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/YARNRunner.java
----------------------------------------------------------------------
diff --git a/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/YARNRunner.java b/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/YARNRunner.java
index 430d43f..8fade03 100644
--- a/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/YARNRunner.java
+++ b/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/YARNRunner.java
@@ -878,7 +878,8 @@ public class YARNRunner implements ClientProtocol {
   public void killJob(JobID arg0) throws IOException, InterruptedException {
     /* check if the status is not running, if not send kill to RM */
     JobStatus status = clientCache.getClient(arg0).getJobStatus(arg0);
-    if (status.getState() != JobStatus.State.RUNNING) {
+    if (status.getState() == JobStatus.State.RUNNING || 
+        status.getState() == JobStatus.State.PREP) {
       try {
         resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
       } catch (YarnException e) {
@@ -886,33 +887,6 @@ public class YARNRunner implements ClientProtocol {
       }
       return;
     }
-
-    try {
-      /* send a kill to the AM */
-      clientCache.getClient(arg0).killJob(arg0);
-      long currentTimeMillis = System.currentTimeMillis();
-      long timeKillIssued = currentTimeMillis;
-      while ((currentTimeMillis < timeKillIssued + 10000L) && (status.getState()
-          != JobStatus.State.KILLED)) {
-          try {
-            Thread.sleep(1000L);
-          } catch(InterruptedException ie) {
-            /** interrupted, just break */
-            break;
-          }
-          currentTimeMillis = System.currentTimeMillis();
-          status = clientCache.getClient(arg0).getJobStatus(arg0);
-      }
-    } catch(IOException io) {
-      LOG.debug("Error when checking for application status", io);
-    }
-    if (status.getState() != JobStatus.State.KILLED) {
-      try {
-        resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
-      } catch (YarnException e) {
-        throw new IOException(e);
-      }
-    }
   }
 
   @Override


Mime
View raw message