hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-4613) hbase.util.Threads#threadDumpingIsAlive sleeps 1 second, slowing down the shutdown by 0.5s
Date Tue, 01 Nov 2011 02:08:34 GMT

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

Hudson commented on HBASE-4613:
-------------------------------

Integrated in HBase-0.92 #90 (See [https://builds.apache.org/job/HBase-0.92/90/])
    HBASE-4613 hbase.util.Threads#threadDumpingIsAlive sleeps 1 second, slowing down the shutdown
by 0.5s

stack : 
Files : 
* /hbase/branches/0.92/CHANGES.txt
* /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/Threads.java

                
> hbase.util.Threads#threadDumpingIsAlive sleeps 1 second, slowing down the shutdown by
0.5s
> ------------------------------------------------------------------------------------------
>
>                 Key: HBASE-4613
>                 URL: https://issues.apache.org/jira/browse/HBASE-4613
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 0.94.0
>         Environment: all
>            Reporter: nkeywal
>            Assignee: nkeywal
>            Priority: Minor
>             Fix For: 0.92.0
>
>         Attachments: 20111020_4613_Threads.patch
>
>
> Current implementation is:
> {noformat} 
>   /**
>    * @param t Waits on the passed thread to die dumping a threaddump every
>    * minute while its up.
>    * @throws InterruptedException
>    */
>   public static void threadDumpingIsAlive(final Thread t)
>   throws InterruptedException {
>     if (t == null) {
>       return;
>     }
>     long startTime = System.currentTimeMillis();
>     while (t.isAlive()) {
>       Thread.sleep(1000);
>       if (System.currentTimeMillis() - startTime > 60000) {
>         startTime = System.currentTimeMillis();
>         ReflectionUtils.printThreadInfo(new PrintWriter(System.out),
>             "Automatic Stack Trace every 60 seconds waiting on " +
>             t.getName());
>       }
>     }
>   }
> {noformat} 
> while this one would make more sense considering the documentation, and save around 0,5s
when the MiniCluster shutdowns.
> {noformat}
>   public static void threadDumpingIsAlive(final Thread t)
>     throws InterruptedException {
>     if (t == null) {
>       return;
>     }
>     while (t.isAlive()) {
>       t.join(60 * 1000);
>       if (t.isAlive()) {
>         ReflectionUtils.printThreadInfo(new PrintWriter(System.out),
>           "Automatic Stack Trace every 60 seconds waiting on " +
>             t.getName());
>       }
>     }
>   }
> {noformat} 
> However, it was replacing a previous implementation with a join without a timeout. So
if anyone has a warning here...
> Tests seems to be ok...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message