-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] when watched files are deleted, logged Error: undefined method `pe=' for #<Fluent::TailInput::TailWatcher::NullIOHandler #920
Comments
I confirmed this occurs at current master branch on my windows10 PC with Ruby2.2. Then I unmerged #788 (@64c5d0c) from in_tail by text editor, it didn't reproduce. Finally, I unmerge this section from current master, it didn't reproduce.
open -> stat is good, but stat only is bad, maybe... |
Thanks for the investigation! @nurse Do you know why this situation happens? |
FileWrapper.open keeps given file opening forever, but FileWrapper.stat closes the file after create stat object. |
@nurse Do you have a good idea to resole this problem? Keeping same behaviour with Linux is better. |
I don't understand why above difference affect this issue. |
I explored this issue with pry.
|
Maybe, fluentd expects In |
As far as I checked, |
In that 5 seconds, deleted file can be seen from explorer or
|
Thank your for inspection.
Ah, it seems because of Lazy Write Back of Windows. diff --git a/lib/fluent/plugin/file_wrapper.rb b/lib/fluent/plugin/file_wrapper.rb
index b6ecd41..6a7a39c 100644
--- a/lib/fluent/plugin/file_wrapper.rb
+++ b/lib/fluent/plugin/file_wrapper.rb
@@ -107,7 +107,11 @@ def ino
return 0
end
- by_handle_file_information.unpack("I11Q1")[11] # fileindex
+ fileindex = by_handle_file_information.unpack("I11Q1")[11]
+ if fileindex == 0x305c305c305c305c
+ raise Errno::ENOENT, @path
+ end
+ fileindex
end
def stat |
I checked with 32bit ruby (2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]), this issue does not happen. Difference between 32bit and 64bit occurs in code of `WindowsFile.initialize' showed below.
When
I replaced all |
In
Though INVALID_FILE_HANDLE is defined
In 64bit environment it causes problem. |
Hmm, it sounds windows-pr's issue. On mswin64, it must define INVALID_HANDLE_VALUE as 0xFFFFFFFFFFFFFFFF. |
After released new windows-pr, I will close this issue. |
I've released windows-pr 1.2.5. |
I updated window-pr and confirmed this issue didn't happen with both ruby2.2.4 x86/x64 for the scenario which is 2 times loop of make file -> delete file. |
Update windows-pr lowest dependency to 1.2.5. fix #920
I updated dependency version to v1.2.5. |
On Windows, in_tail plugin causes error when watched files are deleted.
Error message is like below.
(I have not tested on Linux, so I can't say it is OK on Linux...)
Steps to Reproduce
fluentd or td-agent version.
both of them
Environment information, e.g. OS.
Configuration and Logs
It is at revision @c874f9521b0679c8cd4f1853002dcab6b422c454 log.
The text was updated successfully, but these errors were encountered: