From 0f8cb127cd759cdc6422d19d8b28f21198ddfd61 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 2003f94f5f..b306b8d565 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 void start() { } public void stop() throws IOException { - rollEditsRpcExecutor.shutdown(); tailerThread.setShouldRun(false); tailerThread.interrupt(); try { @@ -242,6 +241,8 @@ public void stop() throws IOException { } catch (InterruptedException e) { LOG.warn("Edit log tailer thread exited with an exception"); throw new IOException(e); + } finally { + rollEditsRpcExecutor.shutdown(); } }