浏览代码

HADOOP-15486. Make NetworkTopology#netLock fair. Contributed by Nanda kumar.

Arpit Agarwal 7 年之前
父节点
当前提交
76f38f3f8b

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java

@@ -105,7 +105,7 @@ public class NetworkTopology {
   private boolean clusterEverBeenMultiRack = false;
   private boolean clusterEverBeenMultiRack = false;
 
 
   /** the lock used to manage access */
   /** the lock used to manage access */
-  protected ReadWriteLock netlock = new ReentrantReadWriteLock();
+  protected ReadWriteLock netlock = new ReentrantReadWriteLock(true);
 
 
   // keeping the constructor because other components like MR still uses this.
   // keeping the constructor because other components like MR still uses this.
   public NetworkTopology() {
   public NetworkTopology() {