You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Zezeng Wang (Jira)" <ji...@apache.org> on 2020/02/24 09:58:00 UTC
[jira] [Created] (AVRO-2762) Unknown resource closed
Zezeng Wang created AVRO-2762:
---------------------------------
Summary: 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
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)