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() (#5913)

Signed-off-by: Xin Sun <sunxin@apache.org>
(cherry picked from commit 6c84d39)
  • Loading branch information
Apache9 committed May 17, 2024
1 parent 2790b60 commit bd9d9c9
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -691,15 +691,11 @@ public void join() {
worker.awaitTermination();
}

// 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.getMessage());
// 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 bd9d9c9

Please sign in to comment.