From b12f7a93ec03d4f4c3ddfad1d5c10615ea18c29e Mon Sep 17 00:00:00 2001 From: Matevz Golob Date: Mon, 24 Jun 2019 09:03:43 +0200 Subject: [PATCH 1/3] Update in_bin.rb to be compatible with updates in in_tail.rb --- lib/fluent/plugin/in_bin.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/fluent/plugin/in_bin.rb b/lib/fluent/plugin/in_bin.rb index ce49a56..b9f062d 100644 --- a/lib/fluent/plugin/in_bin.rb +++ b/lib/fluent/plugin/in_bin.rb @@ -33,7 +33,7 @@ module Fluent::Plugin def setup_watcher(path, pe) line_buffer_timer_flusher = (@multiline_mode && @multiline_flush_interval) ? TailWatcher::LineBufferTimerFlusher.new(log, @multiline_flush_interval, &method(:flush_buffer)) : nil - tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher, &method(:receive_lines)) + tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher, @from_encoding, @encoding, open_on_every_update, &method(:receive_lines)) tw.attach do |watcher| timer_execute(:in_tail_timer_trigger, 1, &watcher.method(:on_notify)) if watcher.enable_watch_timer event_loop_attach(watcher.stat_trigger) @@ -42,7 +42,8 @@ module Fluent::Plugin end class TailWatcher < TailInput::TailWatcher - def on_rotate(io) + def on_rotate(stat) + io = Fluent::FileWrapper.open(@path) if @io_handler == nil if io # first time -- 2.30.9 From 271c3b3d4392f84e95c2502029bb5f34ca61f460 Mon Sep 17 00:00:00 2001 From: Matevz Golob Date: Mon, 5 Aug 2019 11:27:50 +0200 Subject: [PATCH 2/3] Update in_bin.rb to be compatible with in_tail.rb. --- lib/fluent/plugin/in_bin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_bin.rb b/lib/fluent/plugin/in_bin.rb index b9f062d..c34fc94 100644 --- a/lib/fluent/plugin/in_bin.rb +++ b/lib/fluent/plugin/in_bin.rb @@ -33,7 +33,7 @@ module Fluent::Plugin def setup_watcher(path, pe) line_buffer_timer_flusher = (@multiline_mode && @multiline_flush_interval) ? TailWatcher::LineBufferTimerFlusher.new(log, @multiline_flush_interval, &method(:flush_buffer)) : nil - tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher, @from_encoding, @encoding, open_on_every_update, &method(:receive_lines)) + tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @enable_stat_watcher, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher, @from_encoding, @encoding, open_on_every_update, &method(:receive_lines)) tw.attach do |watcher| timer_execute(:in_tail_timer_trigger, 1, &watcher.method(:on_notify)) if watcher.enable_watch_timer event_loop_attach(watcher.stat_trigger) -- 2.30.9 From 741aa75a2d41cdad83390f9a2d6ebe3b7cc54a04 Mon Sep 17 00:00:00 2001 From: Matevz Golob Date: Thu, 29 Aug 2019 15:19:47 +0200 Subject: [PATCH 3/3] Revert "Update in_bin.rb to be compatible with in_tail.rb." This reverts commit 271c3b3d4392f84e95c2502029bb5f34ca61f460 /reviewed-on https://lab.nexedi.com/matevzg/fluent-plugin-bin/merge_requests/1 --- lib/fluent/plugin/in_bin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_bin.rb b/lib/fluent/plugin/in_bin.rb index c34fc94..b9f062d 100644 --- a/lib/fluent/plugin/in_bin.rb +++ b/lib/fluent/plugin/in_bin.rb @@ -33,7 +33,7 @@ module Fluent::Plugin def setup_watcher(path, pe) line_buffer_timer_flusher = (@multiline_mode && @multiline_flush_interval) ? TailWatcher::LineBufferTimerFlusher.new(log, @multiline_flush_interval, &method(:flush_buffer)) : nil - tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @enable_stat_watcher, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher, @from_encoding, @encoding, open_on_every_update, &method(:receive_lines)) + tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher, @from_encoding, @encoding, open_on_every_update, &method(:receive_lines)) tw.attach do |watcher| timer_execute(:in_tail_timer_trigger, 1, &watcher.method(:on_notify)) if watcher.enable_watch_timer event_loop_attach(watcher.stat_trigger) -- 2.30.9