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

stack commented on HBASE-5672:
------------------------------

Chunhui I think your patch would be better if it looped until the thread 
isalive came back true -- see 
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#isAlive() -- 
sleeping 1ms each time through rather than do an absolute 10ms wait as in while 
(!t.isAlive) Thread.sleep(1); (It might wait more but will be in the run when 
you go to proceed.
                
> TestLruBlockCache#testBackgroundEvictionThread fails occasionally
> -----------------------------------------------------------------
>
>                 Key: HBASE-5672
>                 URL: https://issues.apache.org/jira/browse/HBASE-5672
>             Project: HBase
>          Issue Type: Bug
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-5672.patch
>
>
> We find TestLruBlockCache#testBackgroundEvictionThread fails occasionally.
> I think it's a problem of the test case.
> Because runEviction() only do evictionThread.evict():
> {code}
> public void evict() {
>       synchronized(this) {
>         this.notify(); // FindBugs NN_NAKED_NOTIFY
>       }
>     }
> {code}
> However when we call evictionThread.evict(), the evictionThread may haven't 
> been in run() in the TestLruBlockCache#testBackgroundEvictionThread.
> If we run the test many times, we could find failture easily.

--
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

        

Reply via email to