From ebf61db566ba2611f7fe2a19158d7d786fb7f868 Mon Sep 17 00:00:00 2001 From: Owen O'Malley Date: Wed, 24 Aug 2011 23:52:08 +0000 Subject: [PATCH] MAPREDUCE-2846. Fix missing synchronization in the task log management. (omalley) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1161324 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce/CHANGES.txt | 5 ++++- .../src/main/java/org/apache/hadoop/mapred/TaskLog.java | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hadoop-mapreduce/CHANGES.txt b/hadoop-mapreduce/CHANGES.txt index 1f719ab107..57c44cf1f5 100644 --- a/hadoop-mapreduce/CHANGES.txt +++ b/hadoop-mapreduce/CHANGES.txt @@ -1133,7 +1133,10 @@ Trunk (unreleased changes) MAPREDUCE-2838. Fix MapReduce builds to use new hadoop-common test jars. (gkesavan via acmurthy) - MAPREDUCE-2859 - Fix eclipse plugin contrib module compilation (gkesavan) + MAPREDUCE-2859. Fix eclipse plugin contrib module compilation (gkesavan) + + MAPREDUCE-2846. Fix missing synchronization in the task log management. + (omalley) Release 0.22.0 - Unreleased diff --git a/hadoop-mapreduce/hadoop-mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java b/hadoop-mapreduce/hadoop-mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java index 810eea3a41..7e978e9cf9 100644 --- a/hadoop-mapreduce/hadoop-mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java +++ b/hadoop-mapreduce/hadoop-mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java @@ -183,9 +183,9 @@ static File getAttemptDir(TaskAttemptID taskid, boolean isCleanup) { private static long prevErrLength; private static long prevLogLength; - private static void writeToIndexFile(String logLocation, - boolean isCleanup) - throws IOException { + private static synchronized + void writeToIndexFile(String logLocation, + boolean isCleanup) throws IOException { // To ensure atomicity of updates to index file, write to temporary index // file first and then rename. File tmpIndexFile = getTmpIndexFile(currentTaskid, isCleanup);