Return-Path: Delivered-To: apmail-hive-dev-archive@www.apache.org Received: (qmail 58312 invoked from network); 24 Jan 2011 13:34:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jan 2011 13:34:09 -0000 Received: (qmail 6407 invoked by uid 500); 24 Jan 2011 13:34:09 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 6244 invoked by uid 500); 24 Jan 2011 13:34:07 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 6228 invoked by uid 500); 24 Jan 2011 13:34:06 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 6222 invoked by uid 99); 24 Jan 2011 13:34:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jan 2011 13:34:06 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jan 2011 13:34:06 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0ODXkhc011941 for ; Mon, 24 Jan 2011 13:33:46 GMT Message-ID: <25534501.153601295876026172.JavaMail.jira@thor> Date: Mon, 24 Jan 2011 08:33:46 -0500 (EST) From: "Bharath R (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Updated: (HIVE-1884) Potential risk of resource leaks in Hive In-Reply-To: <8885651.156961294221226304.JavaMail.jira@thor> 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/HIVE-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bharath R updated HIVE-1884: ----------------------------- Affects Version/s: 0.3.0 0.4.0 0.4.1 0.5.0 > Potential risk of resource leaks in Hive > ---------------------------------------- > > Key: HIVE-1884 > URL: https://issues.apache.org/jira/browse/HIVE-1884 > Project: Hive > Issue Type: Bug > Components: CLI, Metastore, Query Processor, Server Infrastructure > Affects Versions: 0.3.0, 0.4.0, 0.4.1, 0.5.0, 0.6.0 > Environment: Hive 0.6.0, Hadoop 0.20.1 > SUSE Linux Enterprise Server 11 (i586) > Reporter: Mohit Sikri > Attachments: HIVE-1884.1.PATCH > > > h3.There are couple of resource leaks. > h4.For example, > In CliDriver.java, Method :- processReader() the buffered reader is not closed. > h3.Also there are risk(s) of resource(s) getting leaked , in such cases we need to re factor the code to move closing of resources in finally block. > h4. For Example :- > In Throttle.java Method:- checkJobTracker() , the following code snippet might cause resource leak. > {code} > InputStream in = url.openStream(); > in.read(buffer); > in.close(); > {code} > Ideally and as per the best coding practices it should be like below > {code} > InputStream in=null; > try { > in = url.openStream(); > int numRead = in.read(buffer); > } > finally { > IOUtils.closeStream(in); > } > {code} > Similar cases, were found in ExplainTask.java, DDLTask.java etc.Need to re factor all such occurrences. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.