You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Michael Tamm (JIRA)" <ji...@apache.org> on 2009/05/07 00:05:30 UTC

[jira] Commented: (HADOOP-5476) calling new SequenceFile.Reader(...) leaves an InputStream open, if the given sequence file is broken

    [ https://issues.apache.org/jira/browse/HADOOP-5476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706618#action_12706618 ] 

Michael Tamm commented on HADOOP-5476:
--------------------------------------

Hmm, that would not cover all error cases:
if a RuntimeException is thrown by seek(start) or init(tempReader),
in would not be closed.

For me it is a best practice to use try-finally to close opened resources.

> calling new SequenceFile.Reader(...) leaves an InputStream open, if the given sequence file is broken
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-5476
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5476
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: io
>    Affects Versions: 0.19.1, 0.20.0
>            Reporter: Michael Tamm
>            Assignee: Michael Tamm
>         Attachments: test_and_fix_for_HADOOP-5476.patch, updated_test_and_fix_for_HADOOP-5476.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.