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
Call get_fd() to avoid missing file rotations #65
Conversation
See systemd/systemd#7998 and rsyslog/rsyslog#2437 for more information and background.
|
Thanks for the patch ... Could you explain the issue you are seeing? Also looking at CI this breaks many tests ... I haven't looked closely, but it does seem that this change does indeed break the build. I would also like to document the issue upstream with https://github.com/ledbettj/systemd-journal if we can |
|
@errm, here is the comment that describes what is happening in systemd/systemd#7998 (comment). If a journald client does not immediately call To test this one has to:
With the fix in place, one will still periodically observe deleted journal files, but over time they'll be cleaned up. Regarding the existing unit test failures, it seems odd that making such a call changes the behavior that way. It is likely causing journal to ignore the corrupt journal fixture, and that we'll need to "corrupt" them another way. Regarding upstream, filing an issue is fine, but not sure how much that code base should change if the journald APIs haven't changed (they did fix journald to close and vacate journal files, see systemd/systemd#8144). |
|
The error occurs because you are calling a method In order to ensure we call the native get_fd we have two options ...
@ledbettj do you have a view about what we should do here?
|
|
I don't see any issue with exposing If there is an auto-magical fix for this that we can make we can do that as well. The linked issue is supposedly resolved by systemd/systemd#8144 -- so is this not a problem in newer versions of libsystemd? |
|
@ledbettj, newer versions of systemd still leak FDs, but they won't take up diskspace on systems that let you "vacuum" out the contents of a file on disk. It is not a complete fix for all environments, unfortunately. By always calling Hiding this in the open method might be the best way to avoid having to force clients to perform this sequence properly. |
|
Er, hello? This Pull Request is too damn old! Merge or close this, sucka. |
|
I opened a PR upstream that I think should solve these issues ledbettj/systemd-journal#78 I think it will also mean that I can clean up a lot of the mess around dealing with rotations ... |
|
Thanks for your help @portante I just pushed 1.0.1 to rubygems ... |
Pulls in version 1.0.1 or 0.0.11 (for v0.12) of fluent-plugin-systemd See fluent-plugin-systemd/fluent-plugin-systemd#65 for more info about the issue that it fixes. This may manifest in journal files not being correctly deleted by some versions of systemd after they have been rotated.
Pulls in version 1.0.1 or 0.0.11 (for v0.12) of fluent-plugin-systemd See fluent-plugin-systemd/fluent-plugin-systemd#65 for more info about the issue that it fixes. This may manifest in journal files not being correctly deleted by some versions of systemd after they have been rotated. Signed-off-by: Ed Robinson <edward-robinson@cookpad.com>
See systemd/systemd#7998 and rsyslog/rsyslog#2437 for more information and background.