hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Namit Jain (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HIVE-1884) Potential risk of resource leaks in Hive
Date Mon, 24 Jan 2011 17:28:46 GMT

    [ https://issues.apache.org/jira/browse/HIVE-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985830#action_12985830
] 

Namit Jain commented on HIVE-1884:
----------------------------------

I am not surprised - I am not aware of any long hive server deployment, so this code patch
has not been tested at all.

Do you want to add a stress test, which runs for a long time: say 10 hours or so ?
It may not be practical to run it before every commit - but we can schedule it on hudson,
and monitor the results there

> 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
>            Assignee: 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.


Mime
View raw message