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

Alex Newman commented on HBASE-11798:
-------------------------------------

I noticed when trying to commit HBASE-4955 that TestBucketWriterThread can 
zombie in its setup function.

I also noticed
"main" prio=10 tid=0x00007fa9e000a800 nid=0x571 waiting on condition 
[0x00007fa9e6184000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.hadoop.hbase.util.Threads.sleep(Threads.java:143)
        at 
org.apache.hadoop.hbase.io.hfile.bucket.TestBucketWriterThread.setUp(TestBucketWriterThread.java:78)

In the jstack at 
https://builds.apache.org/job/PreCommit-HBASE-Build/10511/console

Looking at the code

    this.plainCacheable = Mockito.mock(Cacheable.class);
    bc.cacheBlock(this.plainKey, plainCacheable);
    while(!bc.ramCache.isEmpty()) Threads.sleep(1); <- where we hang
    assertTrue(q.isEmpty());
    // Now writer thread should be disabled.

At first I was confused but then I realized that isn't Thread.sleep it is 
Threads.sleep
  /**
   * If interrupted, just prints out the interrupt on STDOUT, resets interrupt 
and returns
   * @param millis How long to sleep for in milliseconds.
   */
  public static void sleep(long millis) {
    try {
      Thread.sleep(millis);
    } catch (InterruptedException e) {
      e.printStackTrace();
      Thread.currentThread().interrupt();
    }
  }


I don't know if we need this. I am curious if we can fix it with a different 
sleep command.

> TestBucketWriterThread can zombie test
> --------------------------------------
>
>                 Key: HBASE-11798
>                 URL: https://issues.apache.org/jira/browse/HBASE-11798
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Alex Newman
>            Assignee: Alex Newman
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to