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

Errno::ENOENT seen in Discoverer when a discovered file is immediately removed. #204

Closed
guyboertje opened this issue Aug 3, 2018 · 1 comment · Fixed by #208
Closed
Assignees
Labels

Comments

@guyboertje
Copy link
Contributor

If a discovered file is removed before Discoverer has a created a WatchedFile for it then the WatchedFile creation step throws Errno::ENOENT.

@guyboertje guyboertje self-assigned this Aug 3, 2018
@guyboertje guyboertje added the bug label Aug 3, 2018
@guyboertje
Copy link
Contributor Author

This issue applies to version 4.1.0 and above.

Work around fix (not tested).
In file vendor/bundle/jruby/2.3.0/gems/logstash-input-file-4.1.X/lib/filewatch/discoverer.rb
replace the whole if .. end block starting at line 65 with:

        if watched_file.nil?
          begin
            path_stat = PathStatClass.new(pathname)
          rescue Errno::ENOENT
            next
          end
          watched_file = WatchedFile.new(pathname, path_stat, @settings)
          new_discovery = true
        end

guyboertje pushed a commit to guyboertje/logstash-input-file that referenced this issue Sep 7, 2018
This is hard to create a meaningful test for this.
The async `rm` call will have to occur at exactly the right point between a file being discovered and it being deleted.

Fixes logstash-plugins#204
guyboertje pushed a commit that referenced this issue Sep 10, 2018
…#208)

This is hard to create a meaningful test for this.
The async `rm` call will have to occur at exactly the right point between a file being discovered and it being deleted.

Fixes #204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant