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

scribe_tail infinite loop #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

scribe_tail infinite loop #1

wants to merge 1 commit into from

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