Browse Source

MAPREDUCE-2846. Fixed a race condition in writing the log index file that
caused tasks to fail. (omalley)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security@1159732 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 years ago
parent
commit
b26741ad9a
2 changed files with 11 additions and 6 deletions
  1. 6 3
      CHANGES.txt
  2. 5 3
      src/mapred/org/apache/hadoop/mapred/TaskLog.java

+ 6 - 3
CHANGES.txt

@@ -16,9 +16,6 @@ Release 0.20.205.0 - unreleased
     MAPREDUCE-2729. Ensure jobs with reduces which can't be launched due to
     MAPREDUCE-2729. Ensure jobs with reduces which can't be launched due to
     slow-start do not count for user-limits. (Sherry Chen via acmurthy) 
     slow-start do not count for user-limits. (Sherry Chen via acmurthy) 
 
 
-    MAPREDUCE-2651. Fix race condition in Linux task controller for
-    job log directory creation. (Bharath Mundlapudi via llu)
-
     HADOOP-6833. IPC leaks call parameters when exceptions thrown.
     HADOOP-6833. IPC leaks call parameters when exceptions thrown.
     (Todd Lipcon via eli)
     (Todd Lipcon via eli)
   
   
@@ -92,6 +89,12 @@ Release 0.20.204.0 - unreleased
 
 
   BUG FIXES
   BUG FIXES
 
 
+    MAPREDUCE-2846. Fixed a race condition in writing the log index file that
+    caused tasks to fail. (omalley)
+
+    MAPREDUCE-2651. Fix race condition in Linux task controller for
+    job log directory creation. (Bharath Mundlapudi via llu)
+
     MAPREDUCE-2621. TestCapacityScheduler fails with "Queue "q1" does not 
     MAPREDUCE-2621. TestCapacityScheduler fails with "Queue "q1" does not 
     exist". (Sherry Chen via mahadev)
     exist". (Sherry Chen via mahadev)
 
 

+ 5 - 3
src/mapred/org/apache/hadoop/mapred/TaskLog.java

@@ -305,9 +305,11 @@ public class TaskLog {
     }
     }
   }
   }
   
   
-  static void writeToIndexFile(String logLocation,
-      TaskAttemptID currentTaskid, boolean isCleanup,
-      Map<LogName, Long[]> lengths) throws IOException {
+  static synchronized 
+  void writeToIndexFile(String logLocation,
+                        TaskAttemptID currentTaskid, 
+                        boolean isCleanup,
+                        Map<LogName, Long[]> lengths) throws IOException {
     // To ensure atomicity of updates to index file, write to temporary index
     // To ensure atomicity of updates to index file, write to temporary index
     // file first and then rename.
     // file first and then rename.
     File tmpIndexFile = getTmpIndexFile(currentTaskid, isCleanup);
     File tmpIndexFile = getTmpIndexFile(currentTaskid, isCleanup);