You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/01/31 12:59:00 UTC

[jira] [Commented] (IMPALA-11865) Set thread names for Java thread pools

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

ASF subversion and git services commented on IMPALA-11865:
----------------------------------------------------------

Commit 41117e649049b3490639851c611d9d6a044c64c2 in impala's branch refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=41117e649 ]

IMPALA-11865: Set thread names for Java thread pools

Currently, some Java thread pools use the default
thread names, which take the form "pool-N-thread-M".
This sets the thread names to more human-friendly names
by adding a ThreadFactory to Executor thread pools
in our Java code. This should make the jstack output
easier to understand. For example, "pool-8-thread-1"
becomes "TableLoadingSubmitterThread-0".

Testing:
 - Ran jstack locally and verified

Change-Id: I583093eeb2e92a208ee5ea5a023686e36436c4dc
Reviewed-on: http://gerrit.cloudera.org:8080/19458
Reviewed-by: Michael Smith <mi...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Set thread names for Java thread pools
> --------------------------------------
>
>                 Key: IMPALA-11865
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11865
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Frontend
>    Affects Versions: Impala 4.3.0
>            Reporter: Joe McDonnell
>            Assignee: Joe McDonnell
>            Priority: Minor
>
> When I do a jstack on catalogd, a lot of the thread names are very generic:
> {noformat}
> "pool-9-thread-1" #29 prio=5 os_prio=0 tid=0x000000000d60e000 nid=0x1eb754 waiting on condition [0x00007f8364536000]
> {noformat}
> There was already work done on this in IMPALA-7450, which adds information when the threads are processing work. I think we should set the thread name as part of the thread pool definition so that idle threads are easy to identify.
> Here are some locations:
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java#L267]
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/catalog/TableLoadingMgr.java#L151]
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/catalog/TableLoadingMgr.java#L165]
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/catalog/TableLoadingMgr.java#L267]
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/catalog/metastore/CatalogMetastoreServer.java#L111]
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/hooks/QueryEventHookManager.java#L120]
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/service/Frontend.java#L397]
> [https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/service/Frontend.java#L443-L447]
> We do this in other locations by setting a ThreadFactory, for example in CatalogHmsAPIHelper.java:
> {noformat}
>   private static final ExecutorService fallbackFdLoaderPool = Executors
>       .newFixedThreadPool(20,
>           new ThreadFactoryBuilder().setDaemon(true)
>               .setNameFormat("HMS-Filemetadata-loader-%d").build());{noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org