From 7698083d9814be354ed3beb414db7af738e12aee Mon Sep 17 00:00:00 2001 From: chaijunjie0101 <1340011734@qq.com> Date: Mon, 8 Aug 2022 23:22:32 +0800 Subject: [PATCH] HBASE-27282 CME in AuthManager causes region server crash --- .../org/apache/hadoop/hbase/security/access/AuthManager.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java index 7f9853d89397..a24e9d66ced9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java @@ -19,7 +19,6 @@ import java.io.IOException; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -66,7 +65,7 @@ private static class PermissionCache { void put(String name, T perm) { synchronized (mutex) { - Set perms = cache.getOrDefault(name, new HashSet<>()); + Set perms = cache.getOrDefault(name, ConcurrentHashMap.newKeySet()); perms.add(perm); cache.put(name, perms); }