hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r651045 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/net/NetworkTopology.java
Date Wed, 23 Apr 2008 20:31:58 GMT
Author: omalley
Date: Wed Apr 23 13:31:52 2008
New Revision: 651045

URL: http://svn.apache.org/viewvc?rev=651045&view=rev
Log:
HADOOP-3300. Fix locking of explicit locks in NetworkTopology. Contributed by 
Tom White.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/net/NetworkTopology.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=651045&r1=651044&r2=651045&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Apr 23 13:31:52 2008
@@ -71,6 +71,9 @@
     HADOOP-3127. Deleting files in trash should really remove them.
     (Brice Arnould via omalley)
 
+    HADOOP-3300. Fix locking of explicit locks in NetworkTopology.
+    (tomwhite via omalley)
+
 Release 0.17.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/net/NetworkTopology.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/net/NetworkTopology.java?rev=651045&r1=651044&r2=651045&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/net/NetworkTopology.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/net/NetworkTopology.java Wed Apr 23 13:31:52
2008
@@ -317,8 +317,8 @@
       throw new IllegalArgumentException(
         "Not allow to add an inner node: "+NodeBase.getPath(node));
     }
-    netlock.writeLock().lock();
     LOG.info("Adding a new node: "+NodeBase.getPath(node));
+    netlock.writeLock().lock();
     try {
       Node rack = getNode(node.getNetworkLocation());
       if (rack != null && !(rack instanceof InnerNode)) {
@@ -344,12 +344,12 @@
    */ 
   public void remove(Node node) {
     if (node==null) return;
-    netlock.writeLock().lock();
     if( node instanceof InnerNode ) {
       throw new IllegalArgumentException(
         "Not allow to remove an inner node: "+NodeBase.getPath(node));
     }
     LOG.info("Removing a node: "+NodeBase.getPath(node));
+    netlock.writeLock().lock();
     try {
       if (clusterMap.remove(node)) {
         InnerNode rack = (InnerNode)getNode(node.getNetworkLocation());



Mime
View raw message