HBASE-10745 Access ShutdownHook#fsShutdownHooks should be synchronized
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1577588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
47e3864ee0
commit
221bd54ba2
|
@ -198,12 +198,12 @@ public class ShutdownHook {
|
|||
if (hdfsClientFinalizer == null) {
|
||||
throw new RuntimeException("Client finalizer is null, can't suppress!");
|
||||
}
|
||||
synchronized (fsShutdownHooks) {
|
||||
if (!fsShutdownHooks.containsKey(hdfsClientFinalizer) &&
|
||||
!ShutdownHookManager.deleteShutdownHook(hdfsClientFinalizer)) {
|
||||
throw new RuntimeException("Failed suppression of fs shutdown hook: " +
|
||||
hdfsClientFinalizer);
|
||||
}
|
||||
synchronized (fsShutdownHooks) {
|
||||
Integer refs = fsShutdownHooks.get(hdfsClientFinalizer);
|
||||
fsShutdownHooks.put(hdfsClientFinalizer, refs == null ? 1 : refs + 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue