Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-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 626AF4660 for ; Wed, 6 Jul 2011 01:40:41 +0000 (UTC) Received: (qmail 65161 invoked by uid 500); 6 Jul 2011 01:40:41 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 65087 invoked by uid 500); 6 Jul 2011 01:40:40 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 65044 invoked by uid 99); 6 Jul 2011 01:40:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 01:40:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 01:40:38 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B3B3C44742 for ; Wed, 6 Jul 2011 01:40:16 +0000 (UTC) Date: Wed, 6 Jul 2011 01:40:16 +0000 (UTC) From: "Eli Collins (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <1961419580.2436.1309916416732.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1627635793.7816.1309496248661.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HADOOP-7437) IOUtils.copybytes will suppress the stream closure exceptions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-7437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060230#comment-13060230 ] Eli Collins commented on HADOOP-7437: ------------------------------------- Should't this fix all the copyBytes methods, not just one of them? > IOUtils.copybytes will suppress the stream closure exceptions. > --------------------------------------------------------------- > > Key: HADOOP-7437 > URL: https://issues.apache.org/jira/browse/HADOOP-7437 > Project: Hadoop Common > Issue Type: Bug > Components: io > Affects Versions: hudson, 0.23.0 > Reporter: Uma Maheswara Rao G > Assignee: Uma Maheswara Rao G > Fix For: 0.23.0 > > Attachments: HADOOP-7437.patch > > > {code} > public static void copyBytes(InputStream in, OutputStream out, long count, > boolean close) throws IOException { > byte buf[] = new byte[4096]; > long bytesRemaining = count; > int bytesRead; > try { > ............. > ............. > } finally { > if (close) { > closeStream(out); > closeStream(in); > } > } > } > {code} > Here if any exception in closing the stream, it will get suppressed here. > So, better to follow the stream closure pattern as HADOOP-7194. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira