Skip to content

Commit

Permalink
only add warning log only when detect detaching a wrong watcher
Browse files Browse the repository at this point in the history
Signed-off-by: garyzjq <[email protected]>
  • Loading branch information
garyzjq committed Jun 29, 2023
1 parent e9b36c1 commit bcd9a1a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,8 @@ def update_watcher(target_info, pe)
# At shutdown, IOHandler's io will be released automatically after detached the event loop
def detach_watcher(tw, ino, close_io = true)
if @follow_inodes && tw.ino != ino
log.warn("Skip detach_watcher because this is not the expected watcher to be detached",
path: tw.path, current_ino: tw.ino, expect_ino_to_close: ino)
return
log.warn("detach_watcher could be detaching an unexpected tail_watcher with a different ino.",
path: tw.path, actual_ino_in_tw: tw.ino, expect_ino_to_close: ino)
end
tw.watchers.each do |watcher|
event_loop_detach(watcher)
Expand Down

0 comments on commit bcd9a1a

Please sign in to comment.