-
Notifications
You must be signed in to change notification settings - Fork 17
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
FileTail never notices deleted file #22
Comments
I recommend using filewatch instead of this library (jordansissel/ruby-filewatch). It doesn't use inotify due to its weird 'feature' behaviors and bugs in older linux kernels. It also works outside EM. |
+1 Exception: < IOError: closed stream > |
@jordansissel have you got any plans updating "delete" detection for this project? I have build CSV parser based on event machine and yours great work and it would be great if this project could benefit from ruby-filewatch (with EM suggar). |
On Linux at least, FileTail handles rotated files correctly because it gets a moved notification. However, because inotify only notifies for file deletion when all file descriptors on the file are closed, FileTail is never notified when the file is flat out deleted (or, say, another file is renamed over the one being monitored). This means that the tailer hangs, even if the file is created again later.
Here's a fairly crude test case demonstrating the issue - note that the file tail fails to pick up the line written after the file is deleted and recreated ("bar"):
The text was updated successfully, but these errors were encountered: