You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-commits@hadoop.apache.org by jl...@apache.org on 2014/04/18 21:36:18 UTC

svn commit: r1588549 - in /hadoop/common/branches/branch-2/hadoop-yarn-project: CHANGES.txt hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c

Author: jlowe
Date: Fri Apr 18 19:36:18 2014
New Revision: 1588549

URL: http://svn.apache.org/r1588549
Log:
svn merge -c 1588546 FIXES: YARN-1940. deleteAsUser() terminates early without deleting more files on error. Contributed by Rushabh S Shah

Modified:
    hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt?rev=1588549&r1=1588548&r2=1588549&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt Fri Apr 18 19:36:18 2014
@@ -53,6 +53,9 @@ Release 2.5.0 - UNRELEASED
     YARN-1784. TestContainerAllocation assumes CapacityScheduler.
     (Robert Kanter via kasha)
 
+    YARN-1940. deleteAsUser() terminates early without deleting more files on
+    error (Rushabh S Shah via jlowe)
+
 Release 2.4.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c?rev=1588549&r1=1588548&r2=1588549&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c (original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c Fri Apr 18 19:36:18 2014
@@ -1082,6 +1082,7 @@ static int delete_path(const char *full_
     FTS* tree = fts_open(paths, FTS_PHYSICAL | FTS_XDEV, NULL);
     FTSENT* entry = NULL;
     int ret = 0;
+    int ret_errno = 0;
 
     if (tree == NULL) {
       fprintf(LOGFILE,
@@ -1099,7 +1100,13 @@ static int delete_path(const char *full_
           if (rmdir(entry->fts_accpath) != 0) {
             fprintf(LOGFILE, "Couldn't delete directory %s - %s\n", 
                     entry->fts_path, strerror(errno));
-            exit_code = -1;
+            if (errno == EROFS) {
+              exit_code = -1;
+            }
+            // record the first errno
+            if (errno != ENOENT && ret_errno == 0) {
+              ret_errno = errno;
+            }
           }
         }
         break;
@@ -1111,7 +1118,13 @@ static int delete_path(const char *full_
         if (unlink(entry->fts_accpath) != 0) {
           fprintf(LOGFILE, "Couldn't delete file %s - %s\n", entry->fts_path,
                   strerror(errno));
-          exit_code = -1;
+          if (errno == EROFS) {
+            exit_code = -1;
+          }
+          // record the first errno
+          if (errno != ENOENT && ret_errno == 0) {
+            ret_errno = errno;
+          }
         }
         break;
 
@@ -1154,6 +1167,9 @@ static int delete_path(const char *full_
       }
     }
     ret = fts_close(tree);
+    if (ret_errno != 0) {
+      exit_code = -1;
+    }
     if (exit_code == 0 && ret != 0) {
       fprintf(LOGFILE, "Error in fts_close while deleting %s\n", full_path);
       exit_code = -1;