You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by je...@apache.org on 2015/02/26 17:48:11 UTC

tez git commit: TEZ-2133. Secured Impersonation: Failed to delete tez scratch data dir (Chang Li via jeagles)

Repository: tez
Updated Branches:
  refs/heads/master 1ccb0be71 -> 53259aad9


TEZ-2133. Secured Impersonation: Failed to delete tez scratch data dir (Chang Li via jeagles)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/53259aad
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/53259aad
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/53259aad

Branch: refs/heads/master
Commit: 53259aad9d7233281b88b29e1fe15f0fd2c053f8
Parents: 1ccb0be
Author: Jonathan Eagles <je...@gmail.com>
Authored: Thu Feb 26 10:43:36 2015 -0600
Committer: Jonathan Eagles <je...@gmail.com>
Committed: Thu Feb 26 10:43:36 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../org/apache/tez/dag/app/DAGAppMaster.java    | 23 +++++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/53259aad/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ef45e6e..0aae152 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -220,6 +220,7 @@ TEZ-UI CHANGES (TEZ-8):
 Release 0.5.4: Unreleased
 
 ALL CHANGES:
+  TEZ-2133. Secured Impersonation: Failed to delete tez scratch data dir
   TEZ-2058. Flaky test: TestTezJobs::testInvalidQueueSubmission.
   TEZ-2037. Should log TaskAttemptFinishedEvent if taskattempt is recovered to KILLED.
   TEZ-2071. TestAMRecovery should set test names for test DAGs.

http://git-wip-us.apache.org/repos/asf/tez/blob/53259aad/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
index 8fd5626..038e5a2 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
@@ -1703,14 +1703,21 @@ public class DAGAppMaster extends AbstractService {
       // Delete tez scratch data dir
       if (this.tezSystemStagingDir != null) {
         try {
-          FileSystem fs = this.tezSystemStagingDir.getFileSystem(this.amConf);
-          boolean deletedStagingDir = fs.delete(this.tezSystemStagingDir, true);
-          if (!deletedStagingDir) {
-            LOG.warn("Failed to delete tez scratch data dir, path=" + this.tezSystemStagingDir);
-          } else {
-            LOG.info("Completed deletion of tez scratch data dir, path="
-                + this.tezSystemStagingDir);
-          }
+          this.appMasterUgi.doAs(new PrivilegedExceptionAction<Void>() {
+            @Override
+            public Void run() throws Exception {
+              FileSystem fs = tezSystemStagingDir.getFileSystem(amConf);
+              boolean deletedStagingDir = fs.delete(tezSystemStagingDir, true);
+              if (!deletedStagingDir) {
+                LOG.warn("Failed to delete tez scratch data dir, path="
+                + tezSystemStagingDir);
+              } else {
+                LOG.info("Completed deletion of tez scratch data dir, path="
+                  + tezSystemStagingDir);
+              }
+              return null;
+            }
+          });
         } catch (IOException e) {
           // Best effort to delete tez scratch data dir
           LOG.warn("Failed to delete tez scratch data dir", e);