Author: mahadev Date: Fri Oct 21 18:38:26 2011 New Revision: 1187492 URL: http://svn.apache.org/viewvc?rev=1187492&view=rev Log: MAPREDUCE-3163. JobClient spews errors when killing MR2 job. (mahadev) - Merging r1187491 from trunk
Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt?rev=1187492&r1=1187491&r2=1187492&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt Fri Oct 21 18:38:26 2011 @@ -363,6 +363,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3144. Augmented JobHistory with the information needed for serving aggregated logs. (Siddharth Seth via vinodkv) + + MAPREDUCE-3163. JobClient spews errors when killing MR2 job. + (mahadev) OPTIMIZATIONS Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java?rev=1187492&r1=1187491&r2=1187492&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java (original) +++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java Fri Oct 21 18:38:26 2011 @@ -56,21 +56,18 @@ import org.apache.hadoop.mapreduce.v2.ap import org.apache.hadoop.mapreduce.v2.api.records.JobState; import org.apache.hadoop.mapreduce.v2.util.MRApps; import org.apache.hadoop.net.NetUtils; -import org.apache.hadoop.security.SecurityInfo; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.yarn.YarnException; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.YarnApplicationState; -import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnRemoteException; import org.apache.hadoop.yarn.factories.RecordFactory; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; import org.apache.hadoop.yarn.ipc.RPCUtil; import org.apache.hadoop.yarn.ipc.YarnRPC; import org.apache.hadoop.yarn.security.ApplicationTokenIdentifier; -import org.apache.hadoop.yarn.security.SchedulerSecurityInfo; public class ClientServiceDelegate { private static final Log LOG = LogFactory.getLog(ClientServiceDelegate.class); @@ -128,7 +125,7 @@ public class ClientServiceDelegate { if (!forceRefresh && realProxy != null) { return realProxy; } - //TODO RM NPEs for unknown jobs. History may still be aware. + // Possibly allow nulls through the PB tunnel, otherwise deal with an exception // and redirect to the history server. ApplicationReport application = rm.getApplicationReport(appId); @@ -136,7 +133,7 @@ public class ClientServiceDelegate { trackingUrl = application.getTrackingUrl(); } String serviceAddr = null; - while (application == null || YarnApplicationState.RUNNING.equals(application.getYarnApplicationState())) { + while (application == null || YarnApplicationState.RUNNING == application.getYarnApplicationState()) { if (application == null) { LOG.info("Could not get Job info from RM for job " + jobId + ". Redirecting to job history server."); @@ -196,7 +193,6 @@ public class ClientServiceDelegate { * block on it. This is to be able to return job status * on an allocating Application. */ - String user = application.getUser(); if (user == null) { throw RPCUtil.getRemoteException("User is not set in the application report"); @@ -269,16 +265,19 @@ public class ClientServiceDelegate { throw yre; } catch (InvocationTargetException e) { if (e.getTargetException() instanceof YarnRemoteException) { - LOG.warn("Exception thrown by remote end.", e - .getTargetException()); + LOG.warn("Error from remote end: " + e + .getTargetException().getLocalizedMessage()); + LOG.debug("Tracing remote error ", e.getTargetException()); throw (YarnRemoteException) e.getTargetException(); } - LOG.info("Failed to contact AM/History for job " + jobId - + " Will retry..", e.getTargetException()); + LOG.info("Failed to contact AM/History for job " + jobId + + " retrying.."); + LOG.debug("Failed exception on AM/History contact", + e.getTargetException()); forceRefresh = true; } catch (Exception e) { LOG.info("Failed to contact AM/History for job " + jobId - + " Will retry..", e); + + " Will retry.."); LOG.debug("Failing to contact application master", e); forceRefresh = true; } Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java?rev=1187492&r1=1187491&r2=1187492&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java (original) +++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java Fri Oct 21 18:38:26 2011 @@ -212,7 +212,8 @@ public class RMAppImpl implements RMApp && currentAttempt.getFinalApplicationStatus() != null) { return currentAttempt.getFinalApplicationStatus(); } - return createFinalApplicationStatus(this.stateMachine.getCurrentState()); + return + createFinalApplicationStatus(this.stateMachine.getCurrentState()); } finally { this.readLock.unlock(); }