From 97d87b011fa9912740de089fd2e9cbde423972ec 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) --- .../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 7f9853d8939..a24e9d66ced 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 @@ package org.apache.hadoop.hbase.security.access; 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 @@ public final class AuthManager { 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); }