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 6FF332959 for ; Tue, 3 May 2011 15:20:45 +0000 (UTC) Received: (qmail 83028 invoked by uid 500); 3 May 2011 15:20:45 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 82994 invoked by uid 500); 3 May 2011 15:20:45 -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 82979 invoked by uid 99); 3 May 2011 15:20:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 May 2011 15:20:45 +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; Tue, 03 May 2011 15:20:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A0265BF9DC for ; Tue, 3 May 2011 15:20:03 +0000 (UTC) Date: Tue, 3 May 2011 15:20:03 +0000 (UTC) From: "ramkrishna.s.vasudevan (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <282223217.18947.1304436003652.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (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 X-Virus-Checked: Checked by ClamAV on apache.org 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 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 have many wrapped stream for writing and reading. These wrappers are prone to errors. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira