Return-Path: X-Original-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-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 B57B67BD2 for ; Mon, 1 Aug 2011 10:44:00 +0000 (UTC) Received: (qmail 13561 invoked by uid 500); 1 Aug 2011 10:43:58 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 13128 invoked by uid 500); 1 Aug 2011 10:43:42 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 13095 invoked by uid 99); 1 Aug 2011 10:43:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2011 10:43:34 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,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; Mon, 01 Aug 2011 10:43:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 116B798568 for ; Mon, 1 Aug 2011 10:43:10 +0000 (UTC) Date: Mon, 1 Aug 2011 10:43:10 +0000 (UTC) From: "Tsz Wo (Nicholas), SZE (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: <80532134.22583.1312195390068.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <7482545.158651294226986721.JavaMail.jira@thor> Subject: [jira] [Commented] (MAPREDUCE-2243) Close all the file streams propely in a finally block to avoid their leakage. 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 [ https://issues.apache.org/jira/browse/MAPREDUCE-2243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073486#comment-13073486 ] Tsz Wo (Nicholas), SZE commented on MAPREDUCE-2243: --------------------------------------------------- Hi Devaraj, I was trying to commit the patch but there was an additional {{encoder.flush()}} in {{EventWriter.close()}}. Could you fix it? > Close all the file streams propely in a finally block to avoid their leakage. > ----------------------------------------------------------------------------- > > Key: MAPREDUCE-2243 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-2243 > Project: Hadoop Map/Reduce > Issue Type: Improvement > Components: jobtracker, tasktracker > Affects Versions: 0.22.0, 0.23.0 > Environment: NA > Reporter: Bhallamudi Venkata Siva Kamesh > Assignee: Devaraj K > Priority: Minor > Fix For: 0.23.0 > > Attachments: MAPREDUCE-2243-1.patch, MAPREDUCE-2243-2.patch, MAPREDUCE-2243-3.patch, MAPREDUCE-2243.patch > > Original Estimate: 72h > Remaining Estimate: 72h > > In the following classes streams should be closed in finally block to avoid their leakage in the exceptional cases. > CompletedJobStatusStore.java > ------------------------------------------ > dataOut.writeInt(events.length); > for (TaskCompletionEvent event : events) { > event.write(dataOut); > } > dataOut.close() ; > EventWriter.java > ---------------------- > encoder.flush(); > out.close(); > MapTask.java > ------------------- > splitMetaInfo.write(out); > out.close(); > TaskLog > ------------ > 1) str = fis.readLine(); > fis.close(); > 2) dos.writeBytes(Long.toString(new File(logLocation, LogName.SYSLOG > .toString()).length() - prevLogLength) + "\n"); > dos.close(); > TotalOrderPartitioner.java > ----------------------------------- > while (reader.next(key, value)) { > parts.add(key); > key = ReflectionUtils.newInstance(keyClass, conf); > } > reader.close(); -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira