Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7B64DDF7C for ; Tue, 10 Jul 2012 11:54:03 +0000 (UTC) Received: (qmail 43994 invoked by uid 500); 10 Jul 2012 11:54:03 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 43957 invoked by uid 500); 10 Jul 2012 11:54:03 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 43946 invoked by uid 99); 10 Jul 2012 11:54:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 11:54:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 11:54:00 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 90C542388847; Tue, 10 Jul 2012 11:53:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1359621 - in /hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java Date: Tue, 10 Jul 2012 11:53:39 -0000 To: hdfs-commits@hadoop.apache.org From: harsh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120710115339.90C542388847@eris.apache.org> Author: harsh Date: Tue Jul 10 11:53:39 2012 New Revision: 1359621 URL: http://svn.apache.org/viewvc?rev=1359621&view=rev Log: Backport of HDFS-3555 from trunk. svn merge -c 1359619 ../../trunk. (harsh) Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1359621&r1=1359620&r2=1359621&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Tue Jul 10 11:53:39 2012 @@ -110,6 +110,9 @@ Release 2.0.1-alpha - UNRELEASED HDFS-3067. NPE in DFSInputStream.readBuffer if read is repeated on corrupted block. (Henry Robinson via atm) + HDFS-3555. idle client socket triggers DN ERROR log + (should be INFO or DEBUG). (Andy Isaacson via harsh) + OPTIMIZATIONS HDFS-2982. Startup performance suffers when there are many edit log Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java?rev=1359621&r1=1359620&r2=1359621&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java Tue Jul 10 11:53:39 2012 @@ -28,6 +28,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.SocketException; +import java.net.SocketTimeoutException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.util.Arrays; @@ -493,18 +494,27 @@ class BlockSender implements java.io.Clo out.write(buf, 0, dataOff + dataLen); } } catch (IOException e) { - /* Exception while writing to the client. Connection closure from - * the other end is mostly the case and we do not care much about - * it. But other things can go wrong, especially in transferTo(), - * which we do not want to ignore. - * - * The message parsing below should not be considered as a good - * coding example. NEVER do it to drive a program logic. NEVER. - * It was done here because the NIO throws an IOException for EPIPE. - */ - String ioem = e.getMessage(); - if (!ioem.startsWith("Broken pipe") && !ioem.startsWith("Connection reset")) { - LOG.error("BlockSender.sendChunks() exception: ", e); + if (e instanceof SocketTimeoutException) { + /* + * writing to client timed out. This happens if the client reads + * part of a block and then decides not to read the rest (but leaves + * the socket open). + */ + LOG.info("BlockSender.sendChunks() exception: ", e); + } else { + /* Exception while writing to the client. Connection closure from + * the other end is mostly the case and we do not care much about + * it. But other things can go wrong, especially in transferTo(), + * which we do not want to ignore. + * + * The message parsing below should not be considered as a good + * coding example. NEVER do it to drive a program logic. NEVER. + * It was done here because the NIO throws an IOException for EPIPE. + */ + String ioem = e.getMessage(); + if (!ioem.startsWith("Broken pipe") && !ioem.startsWith("Connection reset")) { + LOG.error("BlockSender.sendChunks() exception: ", e); + } } throw ioeToSocketException(e); }