hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhe Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-9347) Invariant assumption in TestQuorumJournalManager.shutdown() is wrong
Date Wed, 16 Dec 2015 22:26:46 GMT

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

Zhe Zhang commented on HDFS-9347:

Thanks Wei-Chiu for the work and Walter for the comment. LGTM overall. A few comments:
# The semantics of {{waitForThreadTermination}} should be to throw {{TimeoutException}} if
the specified {{waitForMillis}} expires. So {{assertNoThreadsMatching}} should catch this
{{TimeoutException}} and {{Assert.fail}}. In other words {{assertNoThreadsMatching}} should
be an actual assertion method, and {{waitForThreadTermination}} should be an actual wait method,
without assertion logic. The current special handling of {{waitForMillis == 0}} works, but
creates unnecessary dependency b/w the 2 methods.
# There are some unnecessary white space changes.

> Invariant assumption in TestQuorumJournalManager.shutdown() is wrong
> --------------------------------------------------------------------
>                 Key: HDFS-9347
>                 URL: https://issues.apache.org/jira/browse/HDFS-9347
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Wei-Chiu Chuang
>            Assignee: Wei-Chiu Chuang
>         Attachments: HDFS-9347.001.patch, HDFS-9347.002.patch
> The code
> {code:title=TestTestQuorumJournalManager.java|borderStyle=solid}
> @After
>   public void shutdown() throws IOException {
>     IOUtils.cleanup(LOG, toClose.toArray(new Closeable[0]));
>     // Should not leak clients between tests -- this can cause flaky tests.
>     // (See HDFS-4643)
>     GenericTestUtils.assertNoThreadsMatching(".*IPC Client.*");
>     if (cluster != null) {
>       cluster.shutdown();
>     }
>   }
> {code}
> implicitly assumes when the call returns from IOUtils.cleanup() (which calls close()
on QuorumJournalManager object), all IPC client connection threads are terminated. However,
there is no internal implementation that enforces this assumption. Even if the bug reported
in HADOOP-12532 is fixed, the internal code still only ensures IPC connections are terminated,
but not the thread.

This message was sent by Atlassian JIRA

View raw message