瀏覽代碼

HADOOP-4924. Fixes a race condition in TaskTracker re-init. Contributed by Devaraj Das.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@728676 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 16 年之前
父節點
當前提交
8c3497488d
共有 2 個文件被更改,包括 8 次插入15 次删除
  1. 2 0
      CHANGES.txt
  2. 6 15
      src/mapred/org/apache/hadoop/mapred/TaskTracker.java

+ 2 - 0
CHANGES.txt

@@ -501,6 +501,8 @@ Release 0.20.0 - Unreleased
     HADOOP-4880. Removes an unnecessary testcase from TestJobTrackerRestart.
     (Amar Kamat via ddas)
 
+    HADOOP-4924. Fixes a race condition in TaskTracker re-init. (ddas)
+
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS

+ 6 - 15
src/mapred/org/apache/hadoop/mapred/TaskTracker.java

@@ -871,21 +871,7 @@ public class TaskTracker
     for (TaskInProgress tip : tasksToClose.values()) {
       tip.jobHasFinished(false);
     }
-
-    // Shutdown local RPC servers.  Do them
-    // in parallel, as RPC servers can take a long
-    // time to shutdown.  (They need to wait a full
-    // RPC timeout, which might be 10-30 seconds.)
-    new Thread("RPC shutdown") {
-      @Override
-      public void run() {
-        if (taskReportServer != null) {
-          taskReportServer.stop();
-          taskReportServer = null;
-        }
-      }
-    }.start();
-
+    
     this.running = false;
         
     // Clear local storage
@@ -911,6 +897,11 @@ public class TaskTracker
       } catch (InterruptedException e) {
       }
     }
+    
+    if (taskReportServer != null) {
+      taskReportServer.stop();
+      taskReportServer = null;
+    }
   }
 
   /**