Procházet zdrojové kódy

commit 118927ae78bdef777af857bbe48a165020acf577
Author: Chris Douglas <cdouglas@apache.org>
Date: Sun Sep 19 21:14:09 2010 -0700

Fix bug where disabled log trunc (eq -1) always attempts to delete log dir


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

Owen O'Malley před 14 roky
rodič
revize
841c27e4c1

+ 2 - 2
src/mapred/org/apache/hadoop/mapred/JvmManager.java

@@ -185,8 +185,8 @@ class JvmManager {
     File logdir = TaskLog.getAttemptDir(firstTask.getTaskID(), 
         firstTask.isTaskCleanupTask());
     //allow for 10% over the limit
-    if (FileUtil.getDU(logdir) >
-        (1.1 * tracker.getRetainSize(firstTask.getTaskID()))){
+    final long retainSize = tracker.getRetainSize(firstTask.getTaskID());
+    if (retainSize >= 0 && FileUtil.getDU(logdir) > (1.1 * retainSize)){
       LOG.info("Deleting user log path since the amount of data in the logs" +
       		" exceeded the allowed " +
       		"log limits " + logdir);