[
https://issues.apache.org/jira/browse/AVRO-2762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17113270#comment-17113270
]
ASF subversion and git services commented on AVRO-2762:
-------------------------------------------------------
Commit cb0d6e88a4f0c985a2ecceab3be77dadd874e3cb in avro's branch
refs/heads/master from zeshuai007
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=cb0d6e8 ]
AVRO-2762:Unkown resource closed
> Unknown resource closed
> -----------------------
>
> Key: AVRO-2762
> URL: https://issues.apache.org/jira/browse/AVRO-2762
> Project: Apache Avro
> Issue Type: Improvement
> Components: java
> Affects Versions: 1.9.2
> Reporter: Zezeng Wang
> Assignee: Zezeng Wang
> Priority: Minor
> Fix For: 1.10.0
>
>
> DataFileReader will open the resource file, but it only deals with the
> resource closing in abnormal situations, and it does not inform the user that
> he needs to actively release the resource.
> {code}
> /** Construct a reader for a file. */
> protected DataFileReader(SeekableInput sin, DatumReader<D> reader, boolean
> closeOnError) throws IOException {
> super(reader);
> try {
> this.sin = new SeekableInputStream(sin);
> initialize(this.sin);
> blockFinished();
> } catch (final Throwable e) {
> if (closeOnError) {
> IOUtils.closeQuietly(sin);
> }
> throw e;
> }
> }
> {code}
> I think we should add a description in the comment to help the user read it.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)