-
Notifications
You must be signed in to change notification settings - Fork 86
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
Detect log rotation and release renamed files #106
Conversation
A bit more work is needed to fix fluent/fluentd#2426 (comment) completely. |
49dd8e4
to
cded489
Compare
serverengine has own log rotation mechanizm and it doesn't have this problem, right? |
2e9cc99
to
557e2fd
Compare
I've changed dependency to optional. |
Looks good to me with optional approach :) |
In the previous vesions, there was no way to detect log rotation event when log file was rotated by external tool (logrotate) It causes that rotated log file was grabbed by DaemonLogger. This was unexpected behavior. This commit fixes by reopening log file correctly. NOTE: This PR depends on inotify so only linux was supported. Usually Fluentd built-in rotation works so this feature is optional. Signed-off-by: Kentaro Hayashi <[email protected]>
I've rebased PR to follow recent master. |
3bac90c
to
e925dbf
Compare
Signed-off-by: Takuro Ashie <[email protected]>
I've added CI for with and w/o rb-notify. |
Signed-off-by: Takuro Ashie <[email protected]>
No, still rb-inotify isn't recognized:
|
Signed-off-by: Takuro Ashie <[email protected]>
Hmm, when I test it on my local environment, sometimes a test stalls. It seems that it reproduced also on GitHub Actions: @kenhys Could you take look this? |
|
|
I've misunderstand rspec workflow. executing do block, call after (if exists), then show it ... label. |
It seems that sometimes |
As far as I know, only 'inter-process locking on rotation' test case stalls. (frequency 2-3 stalls/10times) |
It tend to stall when process(pid2) writes the limit (~30 bytes = log_rotate_age * log_rotate_size), proces(pid2) stucks. |
To clarify the issue:
|
It tend to: pass:
stall:
|
some extent true, but not applied to all cases... |
I'll check the current implementation, again. |
Signed-off-by: Takuro Ashie <[email protected]>
I've added a work around, but I'm not sure it's correct fix. |
I open another pull request to resolve this issue: #127 |
In the previous vesions, there was no way to detect log rotation
event when log file was rotated.
It causes that rotated log file was grabbed by DaemonLogger.
This was unexpected behavior.
This commit fixes by reopening log file correctly.
NOTE: This PR depends on inotify so only linux was supported.