Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLINK-3197: InputStream not closed in BinaryInputFormat#createStatistics #1494

Closed
wants to merge 1 commit into from

Conversation

ajaybhat
Copy link
Contributor

@ajaybhat ajaybhat commented Jan 8, 2016

No description provided.

InputStream not closed in BinaryInputFormat#createStatistics
blockInfo.read(new DataInputViewStreamWrapper(fdis));
totalCount += blockInfo.getAccumulatedRecordCount();
fdis.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally it is expected to enclose these type of IO streams/files to be enclosed in a try/finally block.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we should try and consistently use a "try-with-resource" clause for streams.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, or to use the try with resources construct.

StephanEwen pushed a commit to StephanEwen/flink that referenced this pull request Jan 14, 2016
StephanEwen pushed a commit to StephanEwen/flink that referenced this pull request Jan 14, 2016
@asfgit asfgit closed this in 2c556f7 Jan 15, 2016
ChengXiangLi pushed a commit to ChengXiangLi/flink that referenced this pull request Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants