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

Feng Honghua commented on HBASE-10497:
--------------------------------------

The helper method Threads.sleep is implemented as below:
{code}
  public static void sleep(long millis) {
    try {
      Thread.sleep(millis);
    } catch (InterruptedException e) {
      e.printStackTrace();
      Thread.currentThread().interrupt();
    }
  }
{code}
So it's incorrect for tit to be called within a while/for loop(as [~nkeywal] 
pointed out in above comment), but actually it does be called within while/for 
loop several times in HBase code such as in DeleteTableHandler.java, 
AssignmentManager.java, JVMClusterUtil.java, HRegionServer.java and 
LruBlockCache.java (just a search under hbase-server folder). and a method in 
HRegionFileSystem.java calling Threads.sleep itself is called within a do-while 
loop, hence the same problem...

> Add standard handling for swallowed InterruptedException thrown by 
> Thread.sleep under HBase-Client/HBase-Server folders systematically
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-10497
>                 URL: https://issues.apache.org/jira/browse/HBASE-10497
>             Project: HBase
>          Issue Type: Improvement
>          Components: Client, regionserver
>            Reporter: Feng Honghua
>            Assignee: Feng Honghua
>            Priority: Minor
>         Attachments: HBASE-10497-trunk_v1.patch, HBASE-10497-trunk_v2.patch
>
>
> There are many places where InterruptedException thrown by Thread.sleep are 
> swallowed silently (which are neither declared in the caller method's throws 
> clause nor rethrown immediately) under HBase-Client/HBase-Server folders.
> It'd be better to add standard 'log and call currentThread.interrupt' for 
> such cases.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to