diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 56cfad7c5a..20f743f037 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -407,8 +407,10 @@ def setup_watcher(target_info, pe) def construct_watcher(target_info) path = target_info.path + # The file might be rotated or removed after collecting paths, so check inode again here. begin ino = Fluent::FileWrapper.stat(path).ino + target_info.ino = ino rescue Errno::ENOENT, Errno::EACCES $log.warn "stat() for #{path} failed. Continuing without tailing it." return @@ -422,12 +424,13 @@ def construct_watcher(target_info) begin tw = setup_watcher(target_info, pe) - @tails[path] = tw - tw.on_notify rescue WatcherSetupError => e log.warn "Skip #{path} because unexpected setup error happens: #{e}" return end + + @tails[path] = tw + tw.on_notify end def start_watchers(targets_info)