From e3f0bb0f696a52f067efb7f6e15f3204b43b8a56 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 24 May 2022 13:13:34 +0900 Subject: [PATCH] in_tail: Add a missing nil check for rotated_tw in update_watcher The tail watcher for the path might by already removed from @tails by refresh_watchers. Fix #3752 Signed-off-by: Takuro Ashie --- lib/fluent/plugin/in_tail.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index b31d88e7a2..deea7c9498 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -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