From 97a101ca1a54d998af5f4c032966ed7fa66a457a Mon Sep 17 00:00:00 2001 From: chaijunjie0101 <64140218+chaijunjie0101@users.noreply.github.com> Date: Tue, 9 Aug 2022 09:52:31 +0800 Subject: [PATCH] HBASE-27282 CME in AuthManager causes region server crash (#4684) Signed-off-by: Duo Zhang (cherry picked from commit d6641626a97529982720de2b73593e294869c4ca) (cherry picked from commit ae8652cdbdabc7daf87785a127191b9a500e56af) Change-Id: Ib2416a3c13f73e2caedeb8ee04eb8457688e23ac --- .../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); }