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 B325618850 for ; Mon, 18 Apr 2016 13:11:26 +0000 (UTC) Received: (qmail 19696 invoked by uid 500); 18 Apr 2016 13:11:26 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 19460 invoked by uid 500); 18 Apr 2016 13:11:26 -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 19128 invoked by uid 99); 18 Apr 2016 13:11:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Apr 2016 13:11:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 942D62C1F64 for ; Mon, 18 Apr 2016 13:11:25 +0000 (UTC) Date: Mon, 18 Apr 2016 13:11:25 +0000 (UTC) From: "Hudson (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10275) TestDataNodeMetrics failing intermittently due to TotalWriteTime counted incorrectly 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-10275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15245624#comment-15245624 ] Hudson commented on HDFS-10275: ------------------------------- FAILURE: Integrated in Hadoop-trunk-Commit #9626 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/9626/]) HDFS-10275. TestDataNodeMetrics failing intermittently due to (waltersu4549: rev ab903029a9d353677184ff5602966b11ffb408b9) * hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMetrics.java > TestDataNodeMetrics failing intermittently due to TotalWriteTime counted incorrectly > ------------------------------------------------------------------------------------ > > Key: HDFS-10275 > URL: https://issues.apache.org/jira/browse/HDFS-10275 > Project: Hadoop HDFS > Issue Type: Bug > Components: test > Reporter: Lin Yiqun > Assignee: Lin Yiqun > Fix For: 2.7.3 > > Attachments: HDFS-10275.001.patch > > > The unit test {{TestDataNodeMetrics}} fails intermittently. The failed info show these: > {code} > Results : > Failed tests: > TestDataNodeVolumeFailureToleration.testVolumeAndTolerableConfiguration:195->testVolumeConfig:232 expected: but was: > Tests in error: > TestOpenFilesWithSnapshot.testWithCheckpoint:94 ? IO Timed out waiting for Min... > TestDataNodeMetrics.testDataNodeTimeSpend:279 ? Timeout Timed out waiting for ... > TestHFlush.testHFlushInterrupted ? IO The stream is closed > {code} > In line 279 in {{TestDataNodeMetrics}}, it takes place timed out. Then I looked into the code and found the real reason is that the metric of {{TotalWriteTime}} frequently count 0 in each iteration of creating file. And the this leads to retry operations till timeout. > I debug the test in my local. I found the most suspect reason which cause {{TotalWriteTime}} metric count always be 0 is that we using the {{SimulatedFSDataset}} for spending time test. In {{SimulatedFSDataset}}, it will use the inner class's method {{SimulatedOutputStream#write}} to count the write time and the method of this class just updates the {{length}} and throws its data away. > {code} > @Override > public void write(byte[] b, > int off, > int len) throws IOException { > length += len; > } > {code} > So the writing operation hardly not costs any time. So we should use a real way to create file instead of simulated way. I have tested in my local that the test is passed just one time when I delete the simulated way, while the test retries many times to count write time in old way. -- This message was sent by Atlassian JIRA (v6.3.4#6332)