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

Masatake Iwasaki edited comment on HDFS-10468 at 6/1/16 6:43 AM:
-----------------------------------------------------------------

Thanks for working on this, [~jingzhao].

The test worked for me but the expected exception still seems to be thrown 
after some retries in {{DFSInputStream#readWithStrategy}}.

In addition, there is another code path which swallows interrupted exception. 
For example, {{DFSInputStream#chooseDataNode}} catches InterruptedException on 
the {{sleep}} before retries.

{code}
          DFSClient.LOG.warn("DFS chooseDataNode: got # " + (failures + 1) + " 
IOException, will wait for " + waitTime + " msec.");
          Thread.sleep((long)waitTime);
        } catch (InterruptedException ignored) {
        }
{code}

We do not have way out here since {{java.lang.Thread#sleep}} clears interrupted 
status before throwing Interrupted Exception.



was (Author: iwasakims):
Thanks for working on this, [~jingzhao].

The test worked for me but the expected exception still seems to be thrown 
after some retries in {{DFSInputStream#readWithStrategy}}.

In addition, there is another code path which swallows interrupted exception. 
For example, {{DFSInputStream#readWithStrategy}} catches InterruptedException 
on the {{sleep}} before retries.

{code}
          DFSClient.LOG.warn("DFS chooseDataNode: got # " + (failures + 1) + " 
IOException, will wait for " + waitTime + " msec.");
          Thread.sleep((long)waitTime);
        } catch (InterruptedException ignored) {
        }
{code}

We do not have way out here since {{java.lang.Thread#sleep}} clears interrupted 
status before throwing Interrupted Exception.


> HDFS read ends up ignoring an interrupt
> ---------------------------------------
>
>                 Key: HDFS-10468
>                 URL: https://issues.apache.org/jira/browse/HDFS-10468
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Siddharth Seth
>            Assignee: Jing Zhao
>         Attachments: HDFS-10468.000.patch, HDFS-10468.001.patch, log
>
>
> If an interrupt comes in during an HDFS read - it looks like HDFS ends up 
> ignoring it (handling it), and retries the read after an interval.
> An interrupt should result in the read being cancelled, with an 
> InterruptedException being thrown.
> Similarly - if an HDFS op is started with the interrupt status on the thread 
> set, an InterruptedException should be thrown.
> cc [~jingzhao]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to