Browse Source

MAPREDUCE-3837. Fixed TaskLog to check for existence of task-attempt log directory before trying to create it.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1360252 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy 13 years ago
parent
commit
abb14cc2c8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/mapred/org/apache/hadoop/mapred/TaskLog.java

+ 1 - 1
src/mapred/org/apache/hadoop/mapred/TaskLog.java

@@ -100,7 +100,7 @@ public class TaskLog {
     String strAttemptLogDir = getTaskAttemptLogDir(taskID, 
         cleanupSuffix, localDirs);
     File attemptLogDir = new File(strAttemptLogDir);
-    if (!attemptLogDir.mkdirs()) {
+    if (!attemptLogDir.exists() && !attemptLogDir.mkdirs()) {
       throw new IOException("Creation of " + attemptLogDir + " failed.");
     }
     String strLinkAttemptLogDir =