From 17daad34d41272e41edff8eee9ec345c95e52690 Mon Sep 17 00:00:00 2001 From: Steve Vaughan Date: Mon, 22 Aug 2022 15:22:23 -0400 Subject: [PATCH] HADOOP-18279. Cancel fileMonitoringTimer even if trustManager isn't defined (#4767) --- .../apache/hadoop/security/ssl/FileBasedKeyStoresFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/FileBasedKeyStoresFactory.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/FileBasedKeyStoresFactory.java index 520047b3a0..4fbb3c8aea 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/FileBasedKeyStoresFactory.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/FileBasedKeyStoresFactory.java @@ -319,8 +319,10 @@ String getPassword(Configuration conf, String alias, String defaultPass) { */ @Override public synchronized void destroy() { - if (trustManager != null) { + if (fileMonitoringTimer != null) { fileMonitoringTimer.cancel(); + } + if (trustManager != null) { trustManager = null; keyManagers = null; trustManagers = null;