From 7b6a69faaac4af36dd5f58d308d8591e7373ae7b Mon Sep 17 00:00:00 2001 From: Steve Vaughan Date: Wed, 1 Feb 2023 16:33:34 -0500 Subject: [PATCH] HADOOP-18279. Cancel fileMonitoringTimer even if trustManager isn't defined (#4789) Co-authored-by: Steve Vaughan Jr --- .../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 236d881581..401509a40b 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;