Skip to content

Commit 61a4c7f

Browse files
committed
HDFS-7932. Speed up the shutdown of datanode during rolling upgrade. Contributed by Kihwal Lee.
1 parent 1ccbc29 commit 61a4c7f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,8 @@ Release 2.7.0 - UNRELEASED
12161216

12171217
HDFS-7816. Unable to open webhdfs paths with "+". (wheat9 via kihwal)
12181218

1219+
HDFS-7932. Speed up the shutdown of datanode during rolling upgrade.(kihwal)
1220+
12191221
BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS
12201222

12211223
HDFS-7720. Quota by Storage Type API, tools and ClientNameNode

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,8 +1724,9 @@ public void shutdown() {
17241724
// termination of receiver threads.
17251725
if (!this.shutdownForUpgrade ||
17261726
(this.shutdownForUpgrade && (Time.monotonicNow() - timeNotified
1727-
> 2500))) {
1727+
> 1000))) {
17281728
this.threadGroup.interrupt();
1729+
break;
17291730
}
17301731
LOG.info("Waiting for threadgroup to exit, active threads is " +
17311732
this.threadGroup.activeCount());
@@ -1736,8 +1737,8 @@ public void shutdown() {
17361737
Thread.sleep(sleepMs);
17371738
} catch (InterruptedException e) {}
17381739
sleepMs = sleepMs * 3 / 2; // exponential backoff
1739-
if (sleepMs > 1000) {
1740-
sleepMs = 1000;
1740+
if (sleepMs > 200) {
1741+
sleepMs = 200;
17411742
}
17421743
}
17431744
this.threadGroup = null;

0 commit comments

Comments
 (0)