hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Masatake Iwasaki (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HDFS-10468) HDFS read ends up ignoring an interrupt
Date Wed, 01 Jun 2016 06:44:12 GMT

    [ 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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message