Skip to content

Commit

Permalink
in_tail: Fix an incorrect error handling
Browse files Browse the repository at this point in the history
It may occur on catching a short-lived log (#3327).

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Apr 13, 2021
1 parent 4b1ee63 commit 9925845
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ def start_watchers(targets_info)
rescue Errno::ENOENT
$log.warn "stat() for #{target_info.path} failed with ENOENT. Drop tail watcher for now."
# explicitly detach and unwatch watcher `tw`.
stop_watchers(target_info, immediate: true, unwatched: true)
tw.unwatched = true
detach_watcher(tw, target_info.ino, false)
end
}
end
Expand Down

0 comments on commit 9925845

Please sign in to comment.