You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2015/02/24 23:41:07 UTC

[jira] [Commented] (MAPREDUCE-2631) Potential resource leaks in BinaryProtocol$TeeOutputStream.java and TaskLogServlet.java

    [ https://issues.apache.org/jira/browse/MAPREDUCE-2631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14335599#comment-14335599 ] 

Hadoop QA commented on MAPREDUCE-2631:
--------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12493553/MAPREDUCE-2631.3.patch
  against trunk revision 9a37247.

    {color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/5222//console

This message is automatically generated.

> Potential resource leaks in BinaryProtocol$TeeOutputStream.java and TaskLogServlet.java
> ---------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2631
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2631
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: jobtracker
>    Affects Versions: 0.23.0
>            Reporter: Ravi Teja Ch N V
>            Assignee: Ravi Teja Ch N V
>         Attachments: MAPREDUCE-2631.1.patch, MAPREDUCE-2631.2.patch, MAPREDUCE-2631.3.patch, MAPREDUCE-2631.patch
>
>
> {code:title=TaskLogServlet.java|borderStyle=solid}
> private void printTaskLog(HttpServletResponse response,
>                             OutputStream out, TaskAttemptID taskId, 
>                             long start, long end, boolean plainText, 
>                             TaskLog.LogName filter, boolean isCleanup) 
>   throws IOException {
>     if (!plainText) {
>       out.write(("<br><b><u>" + filter + " logs</u></b><br>\n" +
>                  "<pre>\n").getBytes());
>     }
>     try {
>       InputStream taskLogReader = 
>         new TaskLog.Reader(taskId, filter, start, end, isCleanup);
>       byte[] b = new byte[65536];
>       int result;
>       while (true) {
>         result = taskLogReader.read(b);
>         if (result > 0) {
>           if (plainText) {
>             out.write(b, 0, result); 
>           } else {
>             HtmlQuoting.quoteHtmlChars(out, b, 0, result);
>           }
>         } else {
>           break;
>         }
>       }
>       taskLogReader.close();
> {code} 
> In the above code, if any exception thrown while reading (taskLogReader.read(b)), taskLogReader will not be closed.
> {code:title=BinaryProtocol$TeeOutputStream.java|borderStyle=solid}
> public void close() throws IOException {
>       flush();
>       file.close();
>       out.close();
>     }
> {code} 
> In the above code, if the file.close() throws any exception out will not be closed.
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)