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

Sergey Soldatov commented on HBASE-11798:
-----------------------------------------

Here is a small evaluation. 
Test create a BucketCache which is create a WriterThread 
After that test disableWriter in the WriterThread, so according to its logic it 
should stop working.
At the time of setting disableWriter test expects that WriterThread is blocking 
by waiting for a new entry in ramQueue. 
The truth is that even if WriterThread is already created and following asserts 
passed:
    assertEquals(writerThreadsCount, bc.writerThreads.length);
    assertEquals(writerThreadsCount, bc.writerQueues.size());
that doesn't mean that .run() was already executed. So, sometimes it could 
happen that the real execution is following:
1. test creates BucketCache
2. BucketCache creates WriterThread
3. test sets WriterThread.disableWriter
4. WriterThread executed run() and stops on the first check that writer is not 
disabled. 

To fix it I suggest to wait until Writer.Thread is executed. One of the way 
without adding an additional flag is to check the thread state. It should be 
WAITING or BLOCKED. Or in other hands is not RUNNABLE. 
patch is attached. 

> 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
>         Attachments: HBASE-11798-v1.patch, HBASE-11798-v2.patch, 
> HBASE-11798-v3.patch
>
>




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

Reply via email to