From 754069906bda1d961bce9f584d0457ee10db6762 Mon Sep 17 00:00:00 2001 From: Xiao Chen Date: Tue, 7 Aug 2018 16:11:37 -0700 Subject: [PATCH] HDFS-13799. TestEditLogTailer#testTriggersLogRollsForAllStandbyNN fails due to missing synchronization between rollEditsRpcExecutor and tailerThread shutdown. Contributed by Hrishikesh Gadre. --- .../apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java index 2003f94f5f8..b306b8d5659 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java @@ -234,7 +234,6 @@ public class EditLogTailer { } public void stop() throws IOException { - rollEditsRpcExecutor.shutdown(); tailerThread.setShouldRun(false); tailerThread.interrupt(); try { @@ -242,6 +241,8 @@ public class EditLogTailer { } catch (InterruptedException e) { LOG.warn("Edit log tailer thread exited with an exception"); throw new IOException(e); + } finally { + rollEditsRpcExecutor.shutdown(); } }