diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 88556ca6ab..09da75fcb1 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -526,6 +526,10 @@ def update_watcher(tail_watcher, pe, new_inode) # so adding close_io argument to avoid this problem. # 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("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) end