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

MonitoringFileHandler can miss rotations #250

Open
gmacon opened this issue Jan 19, 2018 · 1 comment
Open

MonitoringFileHandler can miss rotations #250

gmacon opened this issue Jan 19, 2018 · 1 comment

Comments

@gmacon
Copy link

gmacon commented Jan 19, 2018

Very occasionally (about once every six months or so) I have a host go out of disk because logrotate has rotated the log file but MonitoringFileHandler fails to notice.

I think I have found the cause of this. Currently, in emit, _query_fd is called twice: once before writing out to the file and again after. If the rotation happens to happen between these two points, the change won't be noticed because the new self._last_stat will already have been computed before the "before" value is stashed before the first call.

I think that the call to _query_fd in the constructor should also be removed, or at least the default value of delay should be changed to True for the MonitoringFileHandler.

I can't think of a clean way to write a test demonstrating this bug; if anyone has a good idea, I'd be happy to hear it.

@vmalloc
Copy link
Collaborator

vmalloc commented Jan 22, 2018

@gmacon thanks for reporting! We're open to PRs fixing this issue, as I'm not sure when we will be able to write a fix for it.

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

No branches or pull requests

2 participants