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] [Updated] (HDFS-10185) TestHFlushInterrupted verifies interrupt state incorrectly
Date Mon, 21 Mar 2016 04:09:25 GMT

     [ https://issues.apache.org/jira/browse/HDFS-10185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lin Yiqun updated HDFS-10185:
-----------------------------
    Status: Patch Available  (was: Open)

Attach a initial patch, kindly review.

> 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
(v6.3.4#6332)

Mime
View raw message