-
Notifications
You must be signed in to change notification settings - Fork 10
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
Error on rotated file if new file takes time to appear #18
Comments
Ah, right you are! Thank you for reporting this, and for providing a working example. Looks like this edge case was just missed. There are 2 places that will read 'the remainder' from the FH; one for when the inode changes and one for if the file disappears. The former condition can happen if the file changes in between polls, thus never throwing an I've completed the coding fix, but need to update the tests. This can be merged asap after the US is back from the holiday weekend in a few days. Thanks again. |
When a file's inode changes, or the `stat` call throws causes tail-file to read the remainder of the contents via a FileHandle. If the file disappears, but takes a bit to re-appear, `_readRemainderFromFileHandle()` is erroneously called twice; once for the `ENOENT` from the disappearing file, and once when the new file causes the inode to change. This commit fixes a bug where the FH is nullified after the first call, and thus throws on the subsequent call. Semver: patch Fixes: #18
When a file's inode changes, or the `stat` call throws causes tail-file to read the remainder of the contents via a FileHandle. If the file disappears, but takes a bit to re-appear, `_readRemainderFromFileHandle()` is erroneously called twice; once for the `ENOENT` from the disappearing file, and once when the new file causes the inode to change. This commit fixes a bug where the FH is nullified after the first call, and thus throws on the subsequent call. Semver: patch Fixes: #18
When a file's inode changes, or the `stat` call throws causes tail-file to read the remainder of the contents via a FileHandle. If the file disappears, but takes a bit to re-appear, `_readRemainderFromFileHandle()` is erroneously called twice; once for the `ENOENT` from the disappearing file, and once when the new file causes the inode to change. This commit fixes a bug where the FH is nullified after the first call, and thus throws on the subsequent call. Semver: patch Fixes: #18
When a file's inode changes, or the `stat` call throws causes tail-file to read the remainder of the contents via a FileHandle. If the file disappears, but takes a bit to re-appear, `_readRemainderFromFileHandle()` is erroneously called twice; once for the `ENOENT` from the disappearing file, and once when the new file causes the inode to change. This commit fixes a bug where the FH is nullified after the first call, and thus throws on the subsequent call. Semver: patch Fixes: #18
When a file's inode changes, or the `stat` call throws causes tail-file to read the remainder of the contents via a FileHandle. If the file disappears, but takes a bit to re-appear, `_readRemainderFromFileHandle()` is erroneously called twice; once for the `ENOENT` from the disappearing file, and once when the new file causes the inode to change. This commit fixes a bug where the FH is nullified after the first call, and thus throws on the subsequent call. Semver: patch Fixes: #18
When a file's inode changes, or the `stat` call throws causes tail-file to read the remainder of the contents via a FileHandle. If the file disappears, but takes a bit to re-appear, `_readRemainderFromFileHandle()` is erroneously called twice; once for the `ENOENT` from the disappearing file, and once when the new file causes the inode to change. This commit fixes a bug where the FH is nullified after the first call, and thus throws on the subsequent call. Semver: patch Fixes: #18
When a file's inode changes, or the `stat` call throws causes tail-file to read the remainder of the contents via a FileHandle. If the file disappears, but takes a bit to re-appear, `_readRemainderFromFileHandle()` is erroneously called twice; once for the `ENOENT` from the disappearing file, and once when the new file causes the inode to change. This commit fixes a bug where the FH is nullified after the first call, and thus throws on the subsequent call. Semver: patch Fixes: #18
If the file is rotated and it takes a while for the new file to appear it will fail.
The first error
ENOENT
will be caught and_readRemainderFromFileHandle
will be executed, this will setthis[kFileHandle] = null
and on the next succeding poll it will detect a file rename and call_readRemainderFromFileHandle
again butthis[kFileHandle]
is now null.Example
Output
The text was updated successfully, but these errors were encountered: