Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 16585 invoked from network); 22 Aug 2008 12:42:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Aug 2008 12:42:41 -0000 Received: (qmail 45121 invoked by uid 500); 22 Aug 2008 12:38:31 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 45063 invoked by uid 500); 22 Aug 2008 12:38:31 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 44884 invoked by uid 99); 22 Aug 2008 12:38:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Aug 2008 05:38:30 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Aug 2008 12:37:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C16BB234C31A for ; Fri, 22 Aug 2008 05:34:54 -0700 (PDT) Message-ID: <1814845051.1219408494791.JavaMail.jira@brutus> Date: Fri, 22 Aug 2008 05:34:54 -0700 (PDT) From: "Hudson (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-3592) org.apache.hadoop.fs.FileUtil.copy() will leak input streams if the destination can't be opened In-Reply-To: <1563632568.1213805085089.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-3592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624809#action_12624809 ] Hudson commented on HADOOP-3592: -------------------------------- Integrated in Hadoop-trunk #581 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/581/]) > org.apache.hadoop.fs.FileUtil.copy() will leak input streams if the destination can't be opened > ----------------------------------------------------------------------------------------------- > > Key: HADOOP-3592 > URL: https://issues.apache.org/jira/browse/HADOOP-3592 > Project: Hadoop Core > Issue Type: Bug > Components: fs > Affects Versions: 0.19.0 > Reporter: Steve Loughran > Assignee: Bill de hOra > Priority: Minor > Fix For: 0.19.0 > > Attachments: HADOOP-3592-200807022209.patch, HADOOP-3592.patch, HADOOP-3592.patch > > > FileUtil.copy() relies on IOUtils.copyBytes() to close the incoming streams, which it does. Normally. > But if dstFS.create() raises any kind of IOException, then the inputstream "in", which was created in the line above, will never get closed, and hence be leaked. > InputStream in = srcFS.open(src); > OutputStream out = dstFS.create(dst, overwrite); > IOUtils.copyBytes(in, out, conf, true); > Some try/catch wrapper around the open operations could close the streams if any exception gets thrown at that point in the copy process. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.