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

FIX: fix reader not getting closed. #1474

Merged
merged 4 commits into from
Sep 18, 2020
Merged

Conversation

sudssf
Copy link
Contributor

@sudssf sudssf commented Sep 17, 2020

this lead to s3a connection pool timeout

this lead to s3a connection pool timeout
@sudssf
Copy link
Contributor Author

sudssf commented Sep 17, 2020

Looks like there is no need to create another reader. I can just pass in existing reader @rdblue do you know if this is better fix ? generateOffsetToStartPos(List<BlockMetaData> rowGroups)

@rdblue
Copy link
Contributor

rdblue commented Sep 17, 2020

Thanks, @sudssf! I think we should just close the file for now, and improve the way this works in a follow-up.


try(ParquetFileReader fileReader = newReader(this.file, ParquetReadOptions.builder().build())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: missing space between try and (. This will probably fail validation.

Copy link
Contributor

Choose a reason for hiding this comment

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

While you're changing this, can you remove this. from the variable reference? We use this. to distinguish setting instance fields, not getting instance fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup I will revert to code you posted above :)

@sudssf sudssf force-pushed the fix-reader-leak branch 2 times, most recently from aa8f42a to 2b257db Compare September 17, 2020 23:53
@rdblue rdblue merged commit dda4e2a into apache:master Sep 18, 2020
@rdblue
Copy link
Contributor

rdblue commented Sep 18, 2020

Thanks for the quick fix, @sudssf! I've merged this to master.

@sudssf
Copy link
Contributor Author

sudssf commented Sep 18, 2020

Thanks for the quick fix, @sudssf! I've merged this to master.

thanks I am happy to add tests to catch this kind of issues in future. we build end to end integration tests using local s3a which help capture some of these bugs. let me know if you think it will add value.

@rdblue
Copy link
Contributor

rdblue commented Sep 18, 2020

Sure, more tests are always welcome. What do you have in mind to catch unclosed files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants