hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1136224 - in /hadoop/common/branches/MR-279/mapreduce: CHANGES.txt mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java
Date Wed, 15 Jun 2011 22:31:24 GMT
Author: llu
Date: Wed Jun 15 22:31:23 2011
New Revision: 1136224

URL: http://svn.apache.org/viewvc?rev=1136224&view=rev
Log:
Fix NPE when killing/failing already killed/failed tasks. (llu)

Modified:
    hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java

Modified: hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/CHANGES.txt?rev=1136224&r1=1136223&r2=1136224&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/CHANGES.txt (original)
+++ hadoop/common/branches/MR-279/mapreduce/CHANGES.txt Wed Jun 15 22:31:23 2011
@@ -4,6 +4,8 @@ Trunk (unreleased changes)
 
 
     MAPREDUCE-279
+
+    Fix NPE when killing/failing already killed/failed tasks. (llu)
    
     Update install instructions with svn unsplit (Thomas Graves via mahadev)
 

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java?rev=1136224&r1=1136223&r2=1136224&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java
Wed Jun 15 22:31:23 2011
@@ -396,29 +396,6 @@ public class ClientServiceDelegate {
     (taskReports).toArray(new org.apache.hadoop.mapreduce.TaskReport[0]);
   }
 
-  public Void killJob(JobID jobID) throws YarnRemoteException,
-  YarnRemoteException {
-    org.apache.hadoop.mapreduce.v2.api.records.JobId  nJobID = TypeConverter.toYarn(jobID);
-    KillJobRequest request = recordFactory.newRecordInstance(KillJobRequest.class);
-    try {
-      request.setJobId(nJobID);
-      getProxy(jobID).killJob(request);
-    } catch(YarnRemoteException yre) {//thrown by remote server, no need to redirect
-      LOG.warn(RPCUtil.toString(yre));
-      throw yre;
-    } catch(Exception e) {
-      LOG.debug("Failed to contact application master ", e);
-      try {
-        request.setJobId(nJobID);
-        getRefreshedProxy(jobID).killJob(request);
-      } catch(YarnRemoteException yre) {
-        LOG.warn(RPCUtil.toString(yre));
-        throw yre;
-      }
-    }
-    return null;
-  }
-
   public boolean killTask(TaskAttemptID taskAttemptID, boolean fail)
   throws YarnRemoteException {
     org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID 
@@ -438,13 +415,17 @@ public class ClientServiceDelegate {
       throw yre;
     } catch(Exception e) {
       LOG.debug("Failed to contact application master ", e);
+      MRClientProtocol proxy = getRefreshedProxy(taskAttemptID.getJobID());
+      if (proxy == null) {
+        return false;
+      }
       try {
         if (fail) {
           failRequest.setTaskAttemptId(attemptID);
-          getRefreshedProxy(taskAttemptID.getJobID()).failTaskAttempt(failRequest);
+          proxy.failTaskAttempt(failRequest);
         } else {
           killRequest.setTaskAttemptId(attemptID);
-          getRefreshedProxy(taskAttemptID.getJobID()).killTaskAttempt(killRequest);
+          proxy.killTaskAttempt(killRequest);
         }
       } catch(YarnRemoteException yre) {
         LOG.warn(RPCUtil.toString(yre));



Mime
View raw message