Skip to content

Conversation

@verb
Copy link

@verb verb commented Nov 2, 2010

I tracked down what I think was probably just a typo in scribe_tail's do_tail() that causes it to loop infinitely when the file it's tailing is rotated. The issue is described in the commit message, and it stems from using the stat size from the filename rather than the open file.

scribe_tail is otherwise very useful, thanks for sharing it.

scribe_tail was using the results from stat() rather than fstat() to
detect file truncation, resulting in a false positive when filename
is changed to point to a new, empty file.  scribe_tail would then
rewind the open file (not filename) and replay the log repeatedly.

This changes scribe_tail to use the results from fstat() on the open
file to detect truncation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant