HBASE-27282 CME in AuthManager causes region server crash (#4684)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
chaijunjie0101 2022-08-09 09:52:31 +08:00 committed by GitHub
parent b431652e48
commit d6641626a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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<T> perms = cache.getOrDefault(name, new HashSet<>());
Set<T> perms = cache.getOrDefault(name, ConcurrentHashMap.newKeySet());
perms.add(perm);
cache.put(name, perms);
}