Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9FB7E18BE9 for ; Tue, 17 Nov 2015 18:06:11 +0000 (UTC) Received: (qmail 93658 invoked by uid 500); 17 Nov 2015 18:06:11 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 93575 invoked by uid 500); 17 Nov 2015 18:06:11 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 93332 invoked by uid 99); 17 Nov 2015 18:06:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2015 18:06:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 032BF2C1F6C for ; Tue, 17 Nov 2015 18:06:11 +0000 (UTC) Date: Tue, 17 Nov 2015 18:06:11 +0000 (UTC) From: "Wei-Chiu Chuang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-9347) Invariant assumption in TestQuorumJournalManager.shutdown() is wrong MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-9347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Wei-Chiu Chuang updated HDFS-9347: ---------------------------------- Attachment: HDFS-9347.002.patch Thanks [~walter.k.su] for the suggestion! I refactored the code to reduce duplication in my rev02 code. FYI, there are two currently two tests in TestCheckpoint and TestEditLogAutoroll that use GenericTestUtils.assertNoThreadsMatching(). > 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 (v6.3.4#6332)