Skip to content

Commit

Permalink
Fix: occasional sincedb write issue on Windows machines (#283)
Browse files Browse the repository at this point in the history
On Windows servers we occasionally get exceptions `unknown IOException: java.io.IOException: The handle is invalid` when writing to sincedb file which crashes the plugin and somehow messes with the sincedb file which results in old log files being reprocessed causing duplicates. This change eliminates those exceptions.
  • Loading branch information
fishie authored Mar 23, 2021
1 parent bf4b8e5 commit 51a88e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 4.2.4
- Fix: sincedb_write issue on Windows machines [#283](https://github.com/logstash-plugins/logstash-input-file/pull/283)

## 4.2.3
- Refactor: improve debug logging (log catched exceptions) [#280](https://github.com/logstash-plugins/logstash-input-file/pull/280)

Expand Down
2 changes: 1 addition & 1 deletion lib/filewatch/sincedb_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def atomic_write(time)

# @return expired keys
def non_atomic_write(time)
IO.open(IO.sysopen(@full_path, "w+")) do |io|
File.open(@full_path, "w+") do |io|
@serializer.serialize(@sincedb, io, time.to_f)
end
end
Expand Down
2 changes: 1 addition & 1 deletion logstash-input-file.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|

s.name = 'logstash-input-file'
s.version = '4.2.3'
s.version = '4.2.4'
s.licenses = ['Apache-2.0']
s.summary = "Streams events from files"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Expand Down

0 comments on commit 51a88e1

Please sign in to comment.