You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2024/05/17 09:45:00 UTC

[jira] [Commented] (HBASE-26048) [JDK17] Replace the usage of deprecated API ThreadGroup.destroy()

    [ https://issues.apache.org/jira/browse/HBASE-26048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17847217#comment-17847217 ] 

Duo Zhang commented on HBASE-26048:
-----------------------------------

There is only one place we use ThreadGroup.destroy in our code, in ProcedureExecutor.

{code}
    // 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();
    }
{code}

I think this is just a check and warn, let me provide a patch to remove it.

> [JDK17] Replace the usage of deprecated API ThreadGroup.destroy()
> -----------------------------------------------------------------
>
>                 Key: HBASE-26048
>                 URL: https://issues.apache.org/jira/browse/HBASE-26048
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Wei-Chiu Chuang
>            Priority: Major
>
> According to the JDK17 doc, ThreadGroup.destroy() is deprecated because
> {quote}Deprecated, for removal: This API element is subject to removal in a future version.
> {quote}
> The API and mechanism for destroying a ThreadGroup is inherently flawed. The ability to explicitly or automatically destroy a thread group will be removed in a future release.
> [https://download.java.net/java/early_access/jdk17/docs/api/java.base/java/lang/ThreadGroup.html#destroy(])
> We don't necessarily need to remove this usage now, but the warning sounds bad enough.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)