[ https://issues.apache.org/jira/browse/HBASE-10516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Feng Honghua updated HBASE-10516: --------------------------------- Attachment: HBASE-10516-trunk_v2.patch New patch per [~nkeywal]'s latest feedback: directly rethrow InterruptedIOException for createDir/rename/deleteDir/createDirOnFileSystem(in HRegionFileSystem.java) rather than record and restore interrupt after some retry. This changes a bit the previous semantic in that it doesn't tolerate interrupt during retry, but agree on what you said: 'we can already receive these exceptions today (as we're going network & disk operations, they are likely to check the interrupt status already, or may do it in the future)' [~nkeywal], Thanks for the patient and detailed review! Are you OK with the latest patch? And by the way, would you please help review HBASE-10519/HBASE-10520/HBASE-10521/HBASE-10522/HBASE-10523/HBASE-10524 as well? They are resultant sub-jiras of split as you suggested in the comment of HBASE-10497, should be much easier to review now for each one :-) > Refactor code where Threads.sleep is called within a while/for loop > ------------------------------------------------------------------- > > Key: HBASE-10516 > URL: https://issues.apache.org/jira/browse/HBASE-10516 > Project: HBase > Issue Type: Bug > Components: Client, master, regionserver > Reporter: Feng Honghua > Assignee: Feng Honghua > Attachments: HBASE-10516-trunk_v1.patch, HBASE-10516-trunk_v2.patch > > > Threads.sleep implementation: > {code} > public static void sleep(long millis) { > try { > Thread.sleep(millis); > } catch (InterruptedException e) { > e.printStackTrace(); > Thread.currentThread().interrupt(); > } > } > {code} > From above implementation, the current thread's interrupt status is > restored/reset when InterruptedException is caught and handled. If this > method is called within a while/for loop, if a first InterruptedException is > thrown during sleep, it will make the Threads.sleep in next loop immediately > throw InterruptedException without expected sleep. This behavior breaks the > intention for independent sleep in each loop > I mentioned above in HBASE-10497 and this jira is created to handle it > separately per [~nkeywal]'s suggestion -- This message was sent by Atlassian JIRA (v6.1.5#6160)