Browse Source

HADOOP-18279. Cancel fileMonitoringTimer even if trustManager isn't defined (#4767)

Steve Vaughan 2 years ago
parent
commit
17daad34d4

+ 3 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/FileBasedKeyStoresFactory.java

@@ -319,8 +319,10 @@ public class FileBasedKeyStoresFactory implements KeyStoresFactory {
    */
   @Override
   public synchronized void destroy() {
-    if (trustManager != null) {
+    if (fileMonitoringTimer != null) {
       fileMonitoringTimer.cancel();
+    }
+    if (trustManager != null) {
       trustManager = null;
       keyManagers = null;
       trustManagers = null;