Skip to content

Commit

Permalink
Check inode expectation to detach correct watcher when follow_inodes
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Zhu <[email protected]>
  • Loading branch information
garyzjq committed May 31, 2023
1 parent dcc05e5 commit fbc3c2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ def update_watcher(target_info, pe)
# 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("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
end
tw.watchers.each do |watcher|
event_loop_detach(watcher)
end
Expand Down

0 comments on commit fbc3c2d

Please sign in to comment.