Skip to content

Commit

Permalink
in_tail: Show more information on skipping update_watcher
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ashie committed Jul 25, 2022
1 parent caec5b7 commit 260a08a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 260a08a

Please sign in to comment.