Skip to content

Commit 9043a39

Browse files
committed
Fix leak of file handles that prevents gzip files from being cleaned up
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
1 parent 23a4f71 commit 9043a39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/logstash/outputs/s3/temporary_file_factory.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class IOWrappedGzip
100100

101101
def initialize(file_io)
102102
@file_io = file_io
103-
@gzip_writer = Zlib::GzipWriter.open(file_io)
103+
@gzip_writer = Zlib::GzipWriter.new(file_io)
104104
end
105105

106106
def path

0 commit comments

Comments
 (0)