hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077715 - /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JvmManager.java
Date Fri, 04 Mar 2011 04:47:28 GMT
Author: omalley
Date: Fri Mar  4 04:47:28 2011
New Revision: 1077715

URL: http://svn.apache.org/viewvc?rev=1077715&view=rev
Log:
commit 2ad4f3e7779ba1096b399c6ae720be3abd33be03
Author: Devaraj Das <ddas@yahoo-inc.com>
Date:   Mon Sep 20 01:49:11 2010 -0700

    Fixes an NPE issue in JvmManger's runChild

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JvmManager.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JvmManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JvmManager.java?rev=1077715&r1=1077714&r2=1077715&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JvmManager.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JvmManager.java
Fri Mar  4 04:47:28 2011
@@ -478,18 +478,20 @@ class JvmManager {
         int exitCode = 0;
         try {
           env.vargs.add(Integer.toString(jvmId.getId()));
-          //Launch the task controller to run task JVM
-          String user = jvmToRunningTask.get(jvmId).getTask().getUser();
-          TaskAttemptID taskAttemptId = 
-            jvmToRunningTask.get(jvmId).getTask().getTaskID();
-          String taskAttemptIdStr = 
-            jvmToRunningTask.get(jvmId).getTask().isTaskCleanupTask() ? 
+          TaskRunner runner = jvmToRunningTask.get(jvmId);
+          if (runner != null) {
+            Task task = runner.getTask();
+            //Launch the task controller to run task JVM
+            String user = task.getUser();
+            TaskAttemptID taskAttemptId = task.getTaskID();
+            String taskAttemptIdStr = task.isTaskCleanupTask() ? 
                 (taskAttemptId.toString() + TaskTracker.TASK_CLEANUP_SUFFIX) :
                   taskAttemptId.toString(); 
-          exitCode = tracker.getTaskController().launchTask(user,
-              jvmId.jobId.toString(), taskAttemptIdStr, env.setup,
-              env.vargs, env.workDir, env.stdout.toString(),
-              env.stderr.toString());
+                exitCode = tracker.getTaskController().launchTask(user,
+                    jvmId.jobId.toString(), taskAttemptIdStr, env.setup,
+                    env.vargs, env.workDir, env.stdout.toString(),
+                    env.stderr.toString());
+          }
         } catch (IOException ioe) {
           // do nothing
           // error and output are appropriately redirected



Mime
View raw message