lib/fluent/plugin/in_tail.rb in fluentd-1.1.0 vs lib/fluent/plugin/in_tail.rb in fluentd-1.1.1
- old
+ new
@@ -676,13 +676,18 @@
@receive_lines = receive_lines
@fifo = FIFO.new(@watcher.from_encoding || Encoding::ASCII_8BIT, @watcher.encoding || Encoding::ASCII_8BIT)
@iobuf = ''.force_encoding('ASCII-8BIT')
@lines = []
@io = nil
+ @notify_mutex = Mutex.new
@watcher.log.info "following tail of #{@watcher.path}"
end
def on_notify
+ @notify_mutex.synchronize { handle_notify }
+ end
+
+ def handle_notify
with_io do |io|
begin
read_more = false
if !io.nil? && @lines.empty?