HBASE-27282 CME in AuthManager causes region server crash (#4684)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit d6641626a9
)
This commit is contained in:
parent
6e82a26a51
commit
30f6a17056
|
@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.security.access;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -66,7 +65,7 @@ public final class AuthManager {
|
||||||
|
|
||||||
void put(String name, T perm) {
|
void put(String name, T perm) {
|
||||||
synchronized (mutex) {
|
synchronized (mutex) {
|
||||||
Set<T> perms = cache.getOrDefault(name, new HashSet<>());
|
Set<T> perms = cache.getOrDefault(name, ConcurrentHashMap.newKeySet());
|
||||||
perms.add(perm);
|
perms.add(perm);
|
||||||
cache.put(name, perms);
|
cache.put(name, perms);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue