Skip to content

Commit

Permalink
Merge pull request #4191 from garyzjq/jiaqz/inodestuck
Browse files Browse the repository at this point in the history
in_tail: Check detaching inode when follow_inodes
  • Loading branch information
daipom authored Jun 30, 2023
2 parents 77d7229 + bcd9a1a commit f436211
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f436211

Please sign in to comment.