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

File handle leak when exception in QueueFile construction #179

Merged
merged 2 commits into from
Nov 30, 2017
Merged

File handle leak when exception in QueueFile construction #179

merged 2 commits into from
Nov 30, 2017

Conversation

chrissmith-mcafee
Copy link
Contributor

Fixed issue where a file handle was being leaked when an exception occurred during construction of QueueFile.

This issue was discovered when attempting to delete the file associated
with the QueueFile. The file was locked and couldn't be deleted (this
only occurs on Windows as Linux does not prevent deletion).

In the fix, if any exceptions occur during the construction of
QueueFile, the random access file is closed before returning.

occurred during construction of QueueFile.

This issue was discovered when attempting to delete the file associated
with the QueueFile. The file was locked and couldn't be deleted (this
only occurs on Windows as Linux does not prevent deletion).

In the fix, if any exceptions occur during the construction of
QueueFile, the random access file is closed before returning.
@chrissmith-mcafee
Copy link
Contributor Author

Appears there is a new issue with errorprone (unrelated to these changes) which is causing Travis CI to fail. The unit tests can be updated to use ArrayDeque versus LinkedList to solve this.

@JakeWharton
Copy link
Member

JakeWharton commented Nov 28, 2017 via email

@NightlyNexus
Copy link
Contributor

sorry, that failure was my fault.

Is it alright to use try-with-resources? Tell Java 6 users to use desugar or similar?

@JakeWharton
Copy link
Member

I don't think we should impose that just yet. Maybe in another year once D8 is widely deployed.

@NightlyNexus
Copy link
Contributor

oh, sorry, i read this wrong. looks good.

@JakeWharton JakeWharton merged commit 9fa0a3e into square:master Nov 30, 2017
@JakeWharton
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants