Skip to content

Commit

Permalink
HBASE-26048 [JDK17] Replace the usage of deprecated API ThreadGroup.d…
Browse files Browse the repository at this point in the history
…estroy() (apache#5913)

Signed-off-by: Xin Sun <[email protected]>
  • Loading branch information
Apache9 authored May 17, 2024
1 parent b260199 commit 6c84d39
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -735,14 +735,11 @@ public void join() {
Thread.currentThread().interrupt();
}

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

// reset the in-memory state for testing
Expand Down

0 comments on commit 6c84d39

Please sign in to comment.