HDFS-16586. Purge FsDatasetAsyncDiskService threadgroup; it causes BP… (#4347)

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.
This commit is contained in:
Michael Stack 2022-05-25 17:02:28 -07:00 committed by GitHub
parent 8c492a1d65
commit ae9d671232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -73,7 +73,6 @@ class FsDatasetAsyncDiskService {
private final DataNode datanode; private final DataNode datanode;
private final FsDatasetImpl fsdatasetImpl; private final FsDatasetImpl fsdatasetImpl;
private final ThreadGroup threadGroup;
private Map<String, ThreadPoolExecutor> executors private Map<String, ThreadPoolExecutor> executors
= new HashMap<String, ThreadPoolExecutor>(); = new HashMap<String, ThreadPoolExecutor>();
private Map<String, Set<Long>> deletedBlockIds private Map<String, Set<Long>> deletedBlockIds
@ -91,7 +90,6 @@ class FsDatasetAsyncDiskService {
FsDatasetAsyncDiskService(DataNode datanode, FsDatasetImpl fsdatasetImpl) { FsDatasetAsyncDiskService(DataNode datanode, FsDatasetImpl fsdatasetImpl) {
this.datanode = datanode; this.datanode = datanode;
this.fsdatasetImpl = fsdatasetImpl; this.fsdatasetImpl = fsdatasetImpl;
this.threadGroup = new ThreadGroup(getClass().getSimpleName());
maxNumThreadsPerVolume = datanode.getConf().getInt( maxNumThreadsPerVolume = datanode.getConf().getInt(
DFSConfigKeys.DFS_DATANODE_FSDATASETASYNCDISK_MAX_THREADS_PER_VOLUME_KEY, DFSConfigKeys.DFS_DATANODE_FSDATASETASYNCDISK_MAX_THREADS_PER_VOLUME_KEY,
DFSConfigKeys.DFS_DATANODE_FSDATASETASYNCDISK_MAX_THREADS_PER_VOLUME_DEFAULT); DFSConfigKeys.DFS_DATANODE_FSDATASETASYNCDISK_MAX_THREADS_PER_VOLUME_DEFAULT);
@ -110,7 +108,7 @@ class FsDatasetAsyncDiskService {
synchronized (this) { synchronized (this) {
thisIndex = counter++; thisIndex = counter++;
} }
Thread t = new Thread(threadGroup, r); Thread t = new Thread(r);
t.setName("Async disk worker #" + thisIndex + t.setName("Async disk worker #" + thisIndex +
" for volume " + volume); " for volume " + volume);
return t; return t;