Skip to content

Commit 02ab90b

Browse files
committed
HBASE-26048 [JDK17] Replace the usage of deprecated API ThreadGroup.destroy() (#5913)
Signed-off-by: Xin Sun <[email protected]> (cherry picked from commit 6c84d39)
1 parent 8fe524d commit 02ab90b

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -735,14 +735,11 @@ public void join() {
735735
Thread.currentThread().interrupt();
736736
}
737737

738-
// Destroy the Thread Group for the executors
739-
// TODO: Fix. #join is not place to destroy resources.
740-
try {
741-
threadGroup.destroy();
742-
} catch (IllegalThreadStateException e) {
743-
LOG.error("ThreadGroup {} contains running threads; {}: See STDOUT", this.threadGroup, e);
744-
// This dumps list of threads on STDOUT.
745-
this.threadGroup.list();
738+
// log the still active threads, ThreadGroup.destroy is deprecated in JDK17 and it is not
739+
// necessary for us to must destroy it here, so we just do a check and log
740+
if (threadGroup.activeCount() > 0) {
741+
LOG.error("There are still active thread in group {}, see STDOUT", threadGroup);
742+
threadGroup.list();
746743
}
747744

748745
// reset the in-memory state for testing

0 commit comments

Comments
 (0)