HDFS-16852. Skip KeyProviderCache shutdown hook registration if already shutting down (#5160)
Signed-off-by: Erik Krogen <xkrogen@apache.org>
(cherry picked from commit f7bdf6c667
)
This commit is contained in:
parent
daa33aafff
commit
d43fa95043
|
@ -68,8 +68,11 @@ public class KeyProviderCache {
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
ShutdownHookManager.get().addShutdownHook(new KeyProviderCacheFinalizer(),
|
// Register the shutdown hook when not in shutdown
|
||||||
SHUTDOWN_HOOK_PRIORITY);
|
if (!ShutdownHookManager.get().isShutdownInProgress()) {
|
||||||
|
ShutdownHookManager.get().addShutdownHook(
|
||||||
|
new KeyProviderCacheFinalizer(), SHUTDOWN_HOOK_PRIORITY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyProvider get(final Configuration conf,
|
public KeyProvider get(final Configuration conf,
|
||||||
|
|
Loading…
Reference in New Issue