Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_tail: Fix StatWatcher uses wrong path #3541

Merged
merged 7 commits into from
Nov 2, 2021
4 changes: 2 additions & 2 deletions lib/fluent/plugin/in_tail.rb
Expand Up @@ -370,7 +370,7 @@ def refresh_watchers
target_paths_hash = expand_paths
existence_paths_hash = existence_path

log.debug { "tailing paths: target = #{target_paths.join(",")} | existing = #{existence_paths.join(",")}" }
log.debug { "tailing paths: target = #{target_paths_hash.keys.join(",")} | existing = #{existence_paths_hash.keys.join(",")}" }
majimenez-stratio marked this conversation as resolved.
Show resolved Hide resolved

unwatched_hash = existence_paths_hash.reject {|key, value| target_paths_hash.key?(key)}
added_hash = target_paths_hash.reject {|key, value| existence_paths_hash.key?(key)}
Expand All @@ -389,7 +389,7 @@ def setup_watcher(target_info, pe)
end

if @enable_stat_watcher
tt = StatWatcher.new(path, log) { tw.on_notify }
tt = StatWatcher.new(target_info.path, log) { tw.on_notify }
ashie marked this conversation as resolved.
Show resolved Hide resolved
tw.register_watcher(tt)
end

Expand Down