hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1136747 - in /hadoop/common/branches/MR-279/mapreduce: CHANGES.txt yarn/yarn-server/yarn-server-nodemanager/src/main/c/container-executor/impl/container-executor.c
Date Fri, 17 Jun 2011 00:50:09 GMT
Author: mahadev
Date: Fri Jun 17 00:50:09 2011
New Revision: 1136747

URL: http://svn.apache.org/viewvc?rev=1136747&view=rev
Log:
Fix race condition between multiple localizers on a single node. (cdouglas via mahadev)

Modified:
    hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-nodemanager/src/main/c/container-executor/impl/container-executor.c

Modified: hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/CHANGES.txt?rev=1136747&r1=1136746&r2=1136747&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/CHANGES.txt (original)
+++ hadoop/common/branches/MR-279/mapreduce/CHANGES.txt Fri Jun 17 00:50:09 2011
@@ -4,6 +4,8 @@ Trunk (unreleased changes)
 
 
     MAPREDUCE-279
+    Fix race condition between multiple localizers on a single node. (cdouglas via mahadev)
+
     Improve logging for AM when requesting containers to show the right ask 
     and release fields (mahadev)
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-nodemanager/src/main/c/container-executor/impl/container-executor.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-nodemanager/src/main/c/container-executor/impl/container-executor.c?rev=1136747&r1=1136746&r2=1136747&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-nodemanager/src/main/c/container-executor/impl/container-executor.c
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-nodemanager/src/main/c/container-executor/impl/container-executor.c
Fri Jun 17 00:50:09 2011
@@ -517,32 +517,19 @@ int create_directory_for_user(const char
   uid_t user = geteuid();
   gid_t group = getegid();
   int ret = 0;
-  ret = change_effective_user(tt_uid, tt_gid);
+  ret = change_effective_user(0, tt_gid);
   if (ret == 0) {
-    if (mkdir(path, permissions) == 0) {
+    if (0 == mkdir(path, permissions) || EEXIST == errno) {
       // need to reassert the group sticky bit
       if (chmod(path, permissions) != 0) {
         fprintf(LOGFILE, "Can't chmod %s to add the sticky bit - %s\n",
                 path, strerror(errno));
         ret = -1;
       } else if (change_owner(path, user, tt_gid) != 0) {
+        fprintf(LOGFILE, "Failed to chown %s to %d:%d: %s\n", path, user, tt_gid,
+            strerror(errno));
         ret = -1;
       }
-    } else if (errno == EEXIST) {
-      struct stat file_stat;
-      if (stat(path, &file_stat) != 0) {
-        fprintf(LOGFILE, "Can't stat directory %s - %s\n", path, 
-                strerror(errno));
-        ret = -1;
-      } else {
-        if (file_stat.st_uid != user ||
-            file_stat.st_gid != tt_gid) {
-          fprintf(LOGFILE, "Directory %s owned by wrong user or group. "
-                  "Expected %d:%d and found %d:%d.\n",
-                  path, user, tt_gid, file_stat.st_uid, file_stat.st_gid);
-          ret = -1;
-        }
-      }
     } else {
       fprintf(LOGFILE, "Failed to create directory %s - %s\n", path,
               strerror(errno));



Mime
View raw message