Skip to content

Commit b36a449

Browse files
committed
HBASE-26048 [JDK17] Replace the usage of deprecated API ThreadGroup.destroy() (#5913)
Signed-off-by: Xin Sun <sunxin@apache.org> (cherry picked from commit 6c84d39)
1 parent 5c863bf commit b36a449

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,11 @@ public void join() {
694694
worker.awaitTermination();
695695
}
696696

697-
// Destroy the Thread Group for the executors
698-
// TODO: Fix. #join is not place to destroy resources.
699-
try {
700-
threadGroup.destroy();
701-
} catch (IllegalThreadStateException e) {
702-
LOG.error("ThreadGroup {} contains running threads; {}: See STDOUT", this.threadGroup,
703-
e.getMessage());
704-
// This dumps list of threads on STDOUT.
705-
this.threadGroup.list();
697+
// log the still active threads, ThreadGroup.destroy is deprecated in JDK17 and it is not
698+
// necessary for us to must destroy it here, so we just do a check and log
699+
if (threadGroup.activeCount() > 0) {
700+
LOG.error("There are still active thread in group {}, see STDOUT", threadGroup);
701+
threadGroup.list();
706702
}
707703

708704
// reset the in-memory state for testing

0 commit comments

Comments
 (0)