[ https://issues.apache.org/jira/browse/HIVE-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067286#comment-13067286 ]
jirapos...@reviews.apache.org commented on HIVE-1884: ----------------------------------------------------- ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1098/#review1101 ----------------------------------------------------------- trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java <https://reviews.apache.org/r/1098/#comment2233> Rename this to rc to avoid confusion with the processReader method name. trunk/contrib/src/java/org/apache/hadoop/hive/contrib/util/typedbytes/TypedBytesWritableInput.java <https://reviews.apache.org/r/1098/#comment2234> Fix indentation for the try block. - John On 2011-07-13 14:28:47, chinna wrote: bq. bq. ----------------------------------------------------------- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/1098/ bq. ----------------------------------------------------------- bq. bq. (Updated 2011-07-13 14:28:47) bq. bq. bq. Review request for hive and John Sichi. bq. bq. bq. Summary bq. ------- bq. bq. There are couple of resource leaks. bq. For example, bq. In CliDriver.java, Method :- processReader() the buffered reader is not closed. bq. bq. Also there are risk(s) of resource(s) getting leaked , in such cases refactored the code to move closing of resources in finally block. bq. bq. bq. This addresses bug HIVE-1884. bq. https://issues.apache.org/jira/browse/HIVE-1884 bq. bq. bq. Diffs bq. ----- bq. bq. trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java 1145950 bq. trunk/contrib/src/java/org/apache/hadoop/hive/contrib/util/typedbytes/TypedBytesWritableInput.java 1145950 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 1145950 bq. trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFileInputFormat.java 1145950 bq. bq. Diff: https://reviews.apache.org/r/1098/diff bq. bq. bq. Testing bq. ------- bq. bq. All unit tests passed bq. bq. bq. Thanks, bq. bq. chinna bq. bq. > 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: Chinna Rao Lalam > Attachments: HIVE-1884.1.PATCH, HIVE-1884.2.patch, HIVE-1884.3.patch, > HIVE-1884.4.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. For more information on JIRA, see: http://www.atlassian.com/software/jira