Skip to content

Commit

Permalink
Fixed tast nipticks and updated version to 4.1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
andsel committed Mar 31, 2020
1 parent 2604b81 commit ab806e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<<<<<<< HEAD
## 4.1.17
- Added configuration setting `check_archive_validity` settings to enable gzipped files verification,
issue [#261](https://github.com/logstash-plugins/logstash-input-file/issues/261)
## 4.1.16
- Added configuration setting `check_archive_validity` settings to enable gzipped files verification,
issue [#261](https://github.com/logstash-plugins/logstash-input-file/issues/261)

## 4.1.16
- Added configuration setting exit_after_read to read to EOF and terminate
Expand Down
12 changes: 6 additions & 6 deletions lib/filewatch/read_mode/handlers/read_zip_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ def handle_specifically(watched_file)
end
watched_file.listener.eof
rescue ZipException => e
logger.error("Cannot decompress the gzip file at path: #{watched_file.path}", :exception => e,
:class => e.class.name,
:message => e.message,
:backtrace => e.backtrace)
logger.error("Cannot decompress the gzip file at path: #{watched_file.path}", :exception => e.class,
:message => e.message, :backtrace => e.backtrace)
watched_file.listener.error
else
sincedb_collection.store_last_read(key, watched_file.last_stat_size)
Expand All @@ -64,7 +62,8 @@ def close_and_ignore_ioexception(closeable)
begin
closeable.close
rescue Exception => e # IOException can be thrown by any of the Java classes that implement the Closable interface.
logger.warn("Ignoring an IOException when closing an instance of #{closeable.class.name}", "exception" => e)
logger.warn("Ignoring an IOException when closing an instance of #{closeable.class.name}",
:exception => e.class, :message => e.message, :backtrace => e.backtrace)
end
end

Expand All @@ -79,7 +78,8 @@ def corrupted?(watched_file)
return false
rescue ZipException => e
duration = Time.now - start
logger.warn("#{watched_file.path} is corrupted, #{duration} secs, message: #{e.message}")
logger.warn("Detected corrupted archive #{watched_file.path} file won't be processed", :message => e.message,
:duration => duration.round(3))
return true
ensure
close_and_ignore_ioexception(gzip_stream) unless gzip_stream.nil?
Expand Down

0 comments on commit ab806e8

Please sign in to comment.