logstash-input-file 4.1.7 → 4.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/filewatch/bootstrap.rb +17 -1
- data/lib/filewatch/read_mode/handlers/read_file.rb +4 -1
- data/lib/filewatch/tail_mode/handlers/base.rb +3 -0
- data/lib/filewatch/tail_mode/handlers/grow.rb +1 -1
- data/lib/filewatch/tail_mode/handlers/shrink.rb +1 -1
- data/lib/jars/filewatch-1.0.1.jar +0 -0
- data/logstash-input-file.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b86fa03636ec6ef833c6fced1c2d42abfc5067f34a70bce8d3362a98c91ff566
|
4
|
+
data.tar.gz: 691ab87c3fd89b33d36ffa151be97cd91147aca22d23c1a20a171adc3d104f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe9f47707469145ca8b5343bcaeeeec17aaf193aad821e23db1400454e1f686e27007365e1c44a2d0f58d1d4cb49cb52cb51af90e5077c6c62cce4dac7c1fa3b
|
7
|
+
data.tar.gz: 2b531984da98f653dfa25af2b571b401318980f4b6d93043a0d3c1f7a147a39f4174305cb50ce3634875330bcac871c2b4c08d4bdac1c3256a0c7521a15c4233
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 4.1.8
|
2
|
+
- Fixed problem in tail and read modes where the read loop could get stuck if an IO error occurs in the loop.
|
3
|
+
The file appears to be being read but it is not, suspected with file truncation schemes.
|
4
|
+
[Issue #205](https://github.com/logstash-plugins/logstash-input-file/issues/205)
|
5
|
+
|
1
6
|
## 4.1.7
|
2
7
|
- Fixed problem in rotation handling where the target file being rotated was
|
3
8
|
subjected to the start_position setting when it must always start from the beginning.
|
data/lib/filewatch/bootstrap.rb
CHANGED
@@ -42,7 +42,23 @@ module FileWatch
|
|
42
42
|
end
|
43
43
|
|
44
44
|
BufferExtractResult = Struct.new(:lines, :warning, :additional)
|
45
|
-
|
45
|
+
|
46
|
+
class LoopControlResult
|
47
|
+
attr_reader :count, :size, :more
|
48
|
+
|
49
|
+
def initialize(count, size, more)
|
50
|
+
@count, @size, @more = count, size, more
|
51
|
+
@read_error_detected = false
|
52
|
+
end
|
53
|
+
|
54
|
+
def flag_read_error
|
55
|
+
@read_error_detected = true
|
56
|
+
end
|
57
|
+
|
58
|
+
def keep_looping?
|
59
|
+
!@read_error_detected && @more
|
60
|
+
end
|
61
|
+
end
|
46
62
|
|
47
63
|
class NoSinceDBPathGiven < StandardError; end
|
48
64
|
|
@@ -10,7 +10,7 @@ module FileWatch module ReadMode module Handlers
|
|
10
10
|
loop_control = watched_file.loop_control_adjusted_for_stat_size
|
11
11
|
controlled_read(watched_file, loop_control)
|
12
12
|
sincedb_collection.request_disk_flush
|
13
|
-
break unless loop_control.
|
13
|
+
break unless loop_control.keep_looping?
|
14
14
|
end
|
15
15
|
if watched_file.all_read?
|
16
16
|
# flush the buffer now in case there is no final delimiter
|
@@ -42,14 +42,17 @@ module FileWatch module ReadMode module Handlers
|
|
42
42
|
end
|
43
43
|
rescue EOFError
|
44
44
|
logger.error("controlled_read: eof error reading file", "path" => watched_file.path, "error" => e.inspect, "backtrace" => e.backtrace.take(8))
|
45
|
+
loop_control.flag_read_error
|
45
46
|
break
|
46
47
|
rescue Errno::EWOULDBLOCK, Errno::EINTR
|
47
48
|
logger.error("controlled_read: block or interrupt error reading file", "path" => watched_file.path, "error" => e.inspect, "backtrace" => e.backtrace.take(8))
|
48
49
|
watched_file.listener.error
|
50
|
+
loop_control.flag_read_error
|
49
51
|
break
|
50
52
|
rescue => e
|
51
53
|
logger.error("controlled_read: general error reading file", "path" => watched_file.path, "error" => e.inspect, "backtrace" => e.backtrace.take(8))
|
52
54
|
watched_file.listener.error
|
55
|
+
loop_control.flag_read_error
|
53
56
|
break
|
54
57
|
end
|
55
58
|
end
|
@@ -59,13 +59,16 @@ module FileWatch module TailMode module Handlers
|
|
59
59
|
end
|
60
60
|
rescue EOFError
|
61
61
|
# it only makes sense to signal EOF in "read" mode not "tail"
|
62
|
+
loop_control.flag_read_error
|
62
63
|
break
|
63
64
|
rescue Errno::EWOULDBLOCK, Errno::EINTR
|
64
65
|
watched_file.listener.error
|
66
|
+
loop_control.flag_read_error
|
65
67
|
break
|
66
68
|
rescue => e
|
67
69
|
logger.error("read_to_eof: general error reading #{watched_file.path}", "error" => e.inspect, "backtrace" => e.backtrace.take(4))
|
68
70
|
watched_file.listener.error
|
71
|
+
loop_control.flag_read_error
|
69
72
|
break
|
70
73
|
end
|
71
74
|
end
|
@@ -8,7 +8,7 @@ module FileWatch module TailMode module Handlers
|
|
8
8
|
break if quit?
|
9
9
|
loop_control = watched_file.loop_control_adjusted_for_stat_size
|
10
10
|
controlled_read(watched_file, loop_control)
|
11
|
-
break unless loop_control.
|
11
|
+
break unless loop_control.keep_looping?
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -9,7 +9,7 @@ module FileWatch module TailMode module Handlers
|
|
9
9
|
break if quit?
|
10
10
|
loop_control = watched_file.loop_control_adjusted_for_stat_size
|
11
11
|
controlled_read(watched_file, loop_control)
|
12
|
-
break unless loop_control.
|
12
|
+
break unless loop_control.keep_looping?
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
Binary file
|
data/logstash-input-file.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-file'
|
4
|
-
s.version = '4.1.
|
4
|
+
s.version = '4.1.8'
|
5
5
|
s.licenses = ['Apache-2.0']
|
6
6
|
s.summary = "Streams events from files"
|
7
7
|
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"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|