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 leak of file handles that prevents gzip files from being cleaned up #193

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

yaauie
Copy link
Contributor

@yaauie yaauie commented Sep 11, 2018

Use Zlib::GzipWriter::new(IO) instead of Zlib::GzipWriter::open(Object), since
the latter effectively creates an additional file handle when passed an IO. This
ensures that when we send Zlib::GzipWriter#close, the original IO is closed in
turn.

Resolves: #190

@yaauie yaauie force-pushed the fix-leak-of-file-handles branch from f1b0a62 to a6d7fe2 Compare September 11, 2018 22:01
@elasticsearch-bot elasticsearch-bot self-assigned this Sep 11, 2018
@guyboertje guyboertje self-requested a review September 12, 2018 13:14
@guyboertje guyboertje assigned yaauie and unassigned guyboertje Sep 12, 2018
Copy link

@guyboertje guyboertje left a comment

Choose a reason for hiding this comment

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

LGTM

Use `Zlib::GzipWriter::new(IO)` instead of `Zlib::GzipWriter::open(Object)`, since
the latter effectively creates an additional file handle when passed an `IO`. This
ensures that when we send `Zlib::GzipWriter#close`, the original `IO` is closed in
turn.

Resolves: logstash-plugins#190
@yaauie yaauie force-pushed the fix-leak-of-file-handles branch from a6d7fe2 to 9043a39 Compare September 25, 2018 17:56
@yaauie
Copy link
Contributor Author

yaauie commented Sep 25, 2018

bumped version and added changelog note, will merge/publish once the build goes green

@yaauie yaauie merged commit 61cb751 into logstash-plugins:master Sep 25, 2018
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.

Temporary gzip files are not removed when deleted
3 participants