hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject hadoop git commit: YARN-6433. Only accessible cgroup mount directories should be selected for a controller. (Miklos Szegedi via kasha)
Date Fri, 14 Apr 2017 22:07:35 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk a41f8dd58 -> 8a1d7480f


YARN-6433. Only accessible cgroup mount directories should be selected for a controller. (Miklos
Szegedi via kasha)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8a1d7480
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8a1d7480
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8a1d7480

Branch: refs/heads/trunk
Commit: 8a1d7480f73906d8e0342690ec6c6b008d6de21b
Parents: a41f8dd
Author: Karthik Kambatla <kasha@cloudera.com>
Authored: Fri Apr 14 15:07:14 2017 -0700
Committer: Karthik Kambatla <kasha@cloudera.com>
Committed: Fri Apr 14 15:07:14 2017 -0700

----------------------------------------------------------------------
 .../containermanager/linux/resources/CGroupsHandlerImpl.java  | 7 ++++++-
 .../linux/resources/TestCGroupsHandlerImpl.java               | 5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8a1d7480/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandlerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandlerImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandlerImpl.java
index 0b29abc..d5295c5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandlerImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandlerImpl.java
@@ -236,7 +236,12 @@ class CGroupsHandlerImpl implements CGroupsHandler {
       Map<String, List<String>> entries) {
     for (Map.Entry<String, List<String>> e : entries.entrySet()) {
       if (e.getValue().contains(controller)) {
-        return e.getKey();
+        if (new File(e.getKey()).canRead()) {
+          return e.getKey();
+        } else {
+          LOG.warn(String.format(
+              "Skipping inaccessible cgroup mount point %s", e.getKey()));
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8a1d7480/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupsHandlerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupsHandlerImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupsHandlerImpl.java
index 38dc34f..4c0829e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupsHandlerImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupsHandlerImpl.java
@@ -252,6 +252,10 @@ public class TestCGroupsHandlerImpl {
     String cpuMtabContent =
         "none " + parentDir.getAbsolutePath()
             + "/cpu cgroup rw,relatime,cpu 0 0\n";
+    // Mark an empty directory called 'cp' cgroup. It is processed before 'cpu'
+    String cpuMtabContentMissing =
+        "none " + parentDir.getAbsolutePath()
+            + "/cp cgroup rw,relatime,cpu 0 0\n";
     String blkioMtabContent =
         "none " + parentDir.getAbsolutePath()
             + "/blkio cgroup rw,relatime,blkio 0 0\n";
@@ -264,6 +268,7 @@ public class TestCGroupsHandlerImpl {
       }
     }
     FileWriter mtabWriter = new FileWriter(mockMtab.getAbsoluteFile());
+    mtabWriter.write(cpuMtabContentMissing);
     mtabWriter.write(cpuMtabContent);
     mtabWriter.write(blkioMtabContent);
     mtabWriter.close();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message