Skip to content

Commit 51a88e1

Browse files
authored
Fix: occasional sincedb write issue on Windows machines (#283)
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.
1 parent bf4b8e5 commit 51a88e1

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.2.4
2+
- Fix: sincedb_write issue on Windows machines [#283](https://github.com/logstash-plugins/logstash-input-file/pull/283)
3+
14
## 4.2.3
25
- Refactor: improve debug logging (log catched exceptions) [#280](https://github.com/logstash-plugins/logstash-input-file/pull/280)
36

Diff for: lib/filewatch/sincedb_collection.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def atomic_write(time)
232232

233233
# @return expired keys
234234
def non_atomic_write(time)
235-
IO.open(IO.sysopen(@full_path, "w+")) do |io|
235+
File.open(@full_path, "w+") do |io|
236236
@serializer.serialize(@sincedb, io, time.to_f)
237237
end
238238
end

Diff for: logstash-input-file.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22

33
s.name = 'logstash-input-file'
4-
s.version = '4.2.3'
4+
s.version = '4.2.4'
55
s.licenses = ['Apache-2.0']
66
s.summary = "Streams events from files"
77
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"

0 commit comments

Comments
 (0)