Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 72107 invoked from network); 4 Mar 2011 04:47:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Mar 2011 04:47:26 -0000 Received: (qmail 17807 invoked by uid 500); 4 Mar 2011 04:47:26 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 17709 invoked by uid 500); 4 Mar 2011 04:47:26 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 17702 invoked by uid 99); 4 Mar 2011 04:47:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 04:47:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 04:47:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 43B472388C22; Fri, 4 Mar 2011 04:47:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1077711 - /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java Date: Fri, 04 Mar 2011 04:47:05 -0000 To: common-commits@hadoop.apache.org From: omalley@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110304044705.43B472388C22@eris.apache.org> Author: omalley Date: Fri Mar 4 04:47:04 2011 New Revision: 1077711 URL: http://svn.apache.org/viewvc?rev=1077711&view=rev Log: commit 04e76d4c09950795f3953b32d56d712214da0f63 Author: Owen O'Malley Date: Mon Sep 20 09:32:55 2010 -0700 correct the relative paths so that the private dc is cleaned up correctly. Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java?rev=1077711&r1=1077710&r2=1077711&view=diff ============================================================================== --- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java (original) +++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java Fri Mar 4 04:47:04 2011 @@ -303,24 +303,20 @@ public class TrackerDistributedCacheMana Path potentialDeletee = lcacheStatus.localizedLoadPath; Path localizedDir = lcacheStatus.getLocalizedUniqueDir(); if (lcacheStatus.user == null) { - - localFs.delete(potentialDeletee, true); - - // Update the maps baseDirSize and baseDirNumberSubDir - LOG.info("Deleted path " + potentialDeletee); - + LOG.info("Deleted path " + localizedDir); try { localFs.delete(localizedDir, true); } catch (IOException e) { LOG.warn("Could not delete distributed cache empty directory " - + localizedDir); + + localizedDir, e); } - } else { - int userDir = TaskTracker.getUserDir(lcacheStatus.user).length(); - taskController.deleteAsUser(lcacheStatus.user, - potentialDeletee.toString().substring(userDir)); - taskController.deleteAsUser(lcacheStatus.user, - localizedDir.toString().substring(userDir)); + } else { + LOG.info("Deleted path " + localizedDir + " as " + lcacheStatus.user); + String base = lcacheStatus.getBaseDir().toString(); + String userDir = TaskTracker.getUserDir(lcacheStatus.user); + int skip = base.length() + 1 + userDir.length() + 1; + String relative = localizedDir.toString().substring(skip); + taskController.deleteAsUser(lcacheStatus.user, relative); } deleteCacheInfoUpdate(lcacheStatus); }