Skip to content

Commit

Permalink
in_tail: Fix an invalid path reference
Browse files Browse the repository at this point in the history
Fix the following error:

Error: test_should_delete_file_pos_entry_for_non_existing_file_with_follow_inodes(TailInputTest::inode_processing): NoMethodError: undefined method `path' for nil:NilClass
C:/projects/fluentd/lib/fluent/plugin/in_tail.rb:326:in `rescue in block in expand_paths'
C:/projects/fluentd/lib/fluent/plugin/in_tail.rb:318:in `block in expand_paths'
C:/projects/fluentd/lib/fluent/plugin/in_tail.rb:315:in `each'
C:/projects/fluentd/lib/fluent/plugin/in_tail.rb:315:in `expand_paths'
C:/projects/fluentd/lib/fluent/plugin/in_tail.rb:224:in `start'
C:/projects/fluentd/lib/fluent/test/driver/base.rb:114:in `instance_start'
C:/projects/fluentd/lib/fluent/test/driver/base.rb:77:in `run'
C:/projects/fluentd/lib/fluent/test/driver/base_owner.rb:130:in `run'
C:/projects/fluentd/test/plugin/test_in_tail.rb:1439:in `test_should_delete_file_pos_entry_for_non_existing_file_with_follow_inodes'
     1436:       }
     1437:
     1438:       d = create_driver(config, false)
  => 1439:       d.run
     1440:
     1441:       pos_file = File.open("#{TMP_DIR}/tail.pos", "r")
     1442:       pos_file.pos = 0

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Mar 3, 2021
1 parent d066aa2 commit 419ef50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def expand_paths
hash[target_info.path] = target_info
end
rescue Errno::ENOENT
$log.warn "expand_paths: stat() for #{target_info.path} failed with ENOENT. Skip file."
$log.warn "expand_paths: stat() for #{path} failed with ENOENT. Skip file."
end
}
hash
Expand Down

0 comments on commit 419ef50

Please sign in to comment.