hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjs...@apache.org
Subject [22/50] [abbrv] hadoop git commit: HADOOP-10953. NetworkTopology#add calls NetworkTopology#toString without holding the netlock (Liang Xie via Colin P. McCabe)
Date Wed, 11 Feb 2015 19:48:40 GMT
HADOOP-10953. NetworkTopology#add calls NetworkTopology#toString without holding the netlock
(Liang Xie via Colin P. McCabe)


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

Branch: refs/heads/YARN-2928
Commit: 6338ce3ae8870548cac5abe2f685748b5efb13c1
Parents: 3f5431a
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Tue Feb 10 13:24:40 2015 -0800
Committer: Colin Patrick Mccabe <cmccabe@cloudera.com>
Committed: Tue Feb 10 13:24:40 2015 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt           |  3 +++
 .../main/java/org/apache/hadoop/net/NetworkTopology.java  | 10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6338ce3a/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 8b80998..fadc744 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -889,6 +889,9 @@ Release 2.7.0 - UNRELEASED
     HADOOP-11535 TableMapping related tests failed due to 'successful'
     resolving of invalid test hostname. (Kai Zheng via stevel)
 
+    HADOOP-10953. NetworkTopology#add calls NetworkTopology#toString without
+    holding the netlock (Liang Xie via Colin P. McCabe)
+
 Release 2.6.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6338ce3a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
index fc8bf52..c60cc0b 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
@@ -393,14 +393,14 @@ public class NetworkTopology {
    */
   public void add(Node node) {
     if (node==null) return;
-    String oldTopoStr = this.toString();
-    if( node instanceof InnerNode ) {
-      throw new IllegalArgumentException(
-        "Not allow to add an inner node: "+NodeBase.getPath(node));
-    }
     int newDepth = NodeBase.locationToDepth(node.getNetworkLocation()) + 1;
     netlock.writeLock().lock();
     try {
+      String oldTopoStr = this.toString();
+      if( node instanceof InnerNode ) {
+        throw new IllegalArgumentException(
+          "Not allow to add an inner node: "+NodeBase.getPath(node));
+      }
       if ((depthOfAllLeaves != -1) && (depthOfAllLeaves != newDepth)) {
         LOG.error("Error: can't add leaf node " + NodeBase.getPath(node) +
             " at depth " + newDepth + " to topology:\n" + oldTopoStr);


Mime
View raw message