Skip to content

Commit

Permalink
in_tail: Add a missing nil check for rotated_tw in update_watcher
Browse files Browse the repository at this point in the history
The tail watcher for the path might by already removed from @Tails by
refresh_watchers.

Fix #3752

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed May 24, 2022
1 parent 12d445f commit e3f0bb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_tail.rb
Expand Up @@ -511,7 +511,7 @@ def update_watcher(target_info, pe)
if new_position_entry.read_inode == 0
# When follow_inodes is true, it's not cleaned up by refresh_watcher.
# So it should be unwatched here explicitly.
rotated_tw.unwatched = true
rotated_tw.unwatched = true if rotated_tw
@tails[path] = setup_watcher(target_info, new_position_entry)
@tails[path].on_notify
end
Expand Down

0 comments on commit e3f0bb0

Please sign in to comment.