Skip to content

Commit

Permalink
Detach and close watcher explicitly on failure at #start_watchers
Browse files Browse the repository at this point in the history
Watchers should be detached and closed explicitly due to Cool.io
objects.

Signed-off-by: Hiroshi Hatake <hatake@clear-code.com>
  • Loading branch information
cosmo0920 committed Mar 3, 2021
1 parent 48ff30d commit 86c194d
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 @@ -418,7 +418,8 @@ def start_watchers(targets_info)
@tails[target_info] = tw
rescue Errno::ENOENT
$log.warn "stat() for #{target_info.path} failed with ENOENT. Drop tail watcher for now."
# explicitly detach and close watcher `tw`, or is it being garbage-collected?
# explicitly detach and close watcher `tw`.
stop_watchers(target_info, immediate: true, unwatched: true)
end
}
end
Expand Down

0 comments on commit 86c194d

Please sign in to comment.