diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java index 318a60784e3..09cfee1c21f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java @@ -421,7 +421,9 @@ public class ServerManager { */ public Map getOnlineServers() { // Presumption is that iterating the returned Map is OK. - return Collections.unmodifiableMap(this.onlineServers); + synchronized (this.onlineServers) { + return Collections.unmodifiableMap(this.onlineServers); + } }