From ad9b6e8d814d328d6fc29f283f5ad39b9d60f627 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 25 May 2022 16:35:56 -0700 Subject: [PATCH] =?UTF-8?q?HDFS-16586.=20Purge=20FsDatasetAsyncDiskService?= =?UTF-8?q?=20threadgroup;=20it=20causes=20BP=E2=80=A6=20(#4348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the ThreadGroup used by executor factories; they are unused and ThreadGroups auto-destroy when their Thread-member count goes to zero. This behavior is incompatible with the configuration we have on the per-volume executor which is set to let all threads die if no use inside the keepalive time. --- .../datanode/fsdataset/impl/FsDatasetAsyncDiskService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetAsyncDiskService.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetAsyncDiskService.java index aa577a4d2a1..9e4ce26a950 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetAsyncDiskService.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetAsyncDiskService.java @@ -73,7 +73,6 @@ class FsDatasetAsyncDiskService { private final DataNode datanode; private final FsDatasetImpl fsdatasetImpl; - private final ThreadGroup threadGroup; private Map executors = new HashMap(); private Map> deletedBlockIds @@ -91,7 +90,6 @@ class FsDatasetAsyncDiskService { FsDatasetAsyncDiskService(DataNode datanode, FsDatasetImpl fsdatasetImpl) { this.datanode = datanode; this.fsdatasetImpl = fsdatasetImpl; - this.threadGroup = new ThreadGroup(getClass().getSimpleName()); maxNumThreadsPerVolume = datanode.getConf().getInt( DFSConfigKeys.DFS_DATANODE_FSDATASETASYNCDISK_MAX_THREADS_PER_VOLUME_KEY, DFSConfigKeys.DFS_DATANODE_FSDATASETASYNCDISK_MAX_THREADS_PER_VOLUME_DEFAULT); @@ -110,7 +108,7 @@ class FsDatasetAsyncDiskService { synchronized (this) { thisIndex = counter++; } - Thread t = new Thread(threadGroup, r); + Thread t = new Thread(r); t.setName("Async disk worker #" + thisIndex + " for volume " + volume); return t;