hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin Yiqun (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10185) TestHFlushInterrupted verifies interrupt state incorrectly
Date Mon, 21 Mar 2016 10:05:25 GMT

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

Lin Yiqun commented on HDFS-10185:

The failed reason of unit test {{hadoop.hdfs.TestHFlush }} is not related by the change in
patch. And I tested it in local, the result is good.

> TestHFlushInterrupted verifies interrupt state incorrectly
> ----------------------------------------------------------
>                 Key: HDFS-10185
>                 URL: https://issues.apache.org/jira/browse/HDFS-10185
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>            Reporter: Lin Yiqun
>            Assignee: Lin Yiqun
>         Attachments: HDFS-10185.001.patch
> In unit test {{TestHFlush#testHFlushInterrupted}}, there were some places verifying interrupt
state incorrectly. As follow:
> {code}
>       Thread.currentThread().interrupt();
>       try {
>         stm.hflush();
>         // If we made it past the hflush(), then that means that the ack made it back
>        // from the pipeline before we got to the wait() call. In that case we should
>         // still have interrupted status.
>         assertTrue(Thread.interrupted());
>       } catch (InterruptedIOException ie) {
>         System.out.println("Got expected exception during flush");
>       }
> {code}
> When stm do the {{hflush}} operation, it will throw interrupted exception and the {{assertTrue(Thread.interrupted())}}
will not be execute. And if you put this before the {{hflush}}, this method will clear interrupted
state and the expected exception will not be throw. The similar problem also appears after
in stm.close.
> So we should use a way to get state without clearing interrupted state like {{Thread.currentThread().isInterrupted()}}.

This message was sent by Atlassian JIRA

View raw message