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 405046692 for ; Wed, 18 May 2011 15:29:28 +0000 (UTC) Received: (qmail 4567 invoked by uid 500); 18 May 2011 15:29:28 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 4474 invoked by uid 500); 18 May 2011 15:29:27 -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 4466 invoked by uid 99); 18 May 2011 15:29:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2011 15:29:27 +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, 18 May 2011 15:29:26 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 6040ACF97E for ; Wed, 18 May 2011 15:28:47 +0000 (UTC) Date: Wed, 18 May 2011 15:28:47 +0000 (UTC) From: "ramkrishna.s.vasudevan (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <177203204.22625.1305732527390.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <282223217.18947.1304436003652.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (HADOOP-7256) Resource leak during failure scenario of closing of resources. 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/HADOOP-7256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ramkrishna.s.vasudevan updated HADOOP-7256: ------------------------------------------- Fix Version/s: 0.23.0 Hadoop Flags: [Incompatible change, Reviewed] (was: [Incompatible change]) Status: Patch Available (was: Open) > Resource leak during failure scenario of closing of resources. > --------------------------------------------------------------- > > Key: HADOOP-7256 > URL: https://issues.apache.org/jira/browse/HADOOP-7256 > Project: Hadoop Common > Issue Type: Bug > Affects Versions: 0.21.0, 0.20.2 > Reporter: ramkrishna.s.vasudevan > Priority: Minor > Fix For: 0.23.0 > > Attachments: HADOOP-7256-patch-1.patch > > Original Estimate: 8h > Remaining Estimate: 8h > > Problem Statement: > =============== > There are chances of resource leak and stream not getting closed > Take the case when after copying data we try to close the Input and output stream followed by closing of the socket. > Suppose an exception occurs while closing the input stream(due to runtime exception) then the subsequent operations of closing the output stream and socket may not happen and there is a chance of resource leak. > Scenario > ======= > During long run of map reduce jobs, the copyFromLocalFile() api is getting called. > Here we found some exceptions happening. As a result of this we found the lsof value raising leading to resource leak. > Solution: > ======= > While doing a close operation of any resource catch the RuntimeException also rather than catching the IOException alone. > Additionally there are places where we try to close a resource in the catch block. > If this close fails, we just throw and come out of the current flow. > In order to avoid this, we can carry out the close operation in the finally block. > Probable reasons for getting RunTimeExceptions: > ===================================== > We may get runtime exception from customised hadoop streams like FSDataOutputStream.close() . So better to handle RunTimeExceptions also. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira