From 260a08a8d00da0386ed93b4d631114724309f911 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Mon, 25 Jul 2022 17:00:42 +0900 Subject: [PATCH] in_tail: Show more information on skipping update_watcher In #3614 some users reported that in_tail rarely stops tailing. It seems it's caused when skipping update_watcher due to unexpected duplicate pos_file entries. The root cause is unknown yet. To investigate it, show more infomation when it happens. Ideally it should't happen so that log level "warn" is desired for it. Signed-off-by: Takuro Ashie --- lib/fluent/plugin/in_tail.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index deea7c9498..cf12810953 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -498,7 +498,8 @@ def update_watcher(target_info, pe) pe_inode = pe.read_inode target_info_from_position_entry = TargetInfo.new(path, pe_inode) unless pe_inode == @pf[target_info_from_position_entry].read_inode - log.debug "Skip update_watcher because watcher has been already updated by other inotify event" + log.warn "Skip update_watcher because watcher has been already updated by other inotify event", + path: path, inode: pe.read_inode, inode_in_pos_file: @pf[target_info_from_position_entry].read_inode return end end