Navigation Menu

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

Fix systemd journal hang when time is going backwards after a boot #4245

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Dec 17, 2022

This branch fixes #2836 in addition to much needed love to the systemd-journal() module.

It implements features, improves performance and code readability.

  • the dynamic loading of libsystemd.so has greatly been simplified (the Journald wrapper is gone)
  • it improves performance by avoiding at least 3 mallocs per journal fields
  • it adds a matches() option to filter down the journal source, just as you can do with journalctl command line arguments
  • it adds a match-boot() option to filter down the journal source to the current boot

The match-boot() option will default to "yes" if you are using the system() source, "no" otherwise.

I worked from the patch provided by @TaborKelly originally but I am afraid most of his code will be completely eliminated by the time this is merged.

This needs some testing for sure, I am opening the PR to solicit feedback and to do that testing first, thus this is WIP.

@TaborKelly can you please check if this works for you? Thanks

@github-actions
Copy link
Contributor

No news file has been detected. Please write one, if applicable.

@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi bazsi force-pushed the fix-systemd-journal-hang-when-time-is-going-backwards-after-a-boot branch from 340f0dd to 7e79bc6 Compare December 17, 2022 13:50
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi
Copy link
Collaborator Author

bazsi commented Dec 18, 2022

This is not yet operational, sorry. I am still fighting with the unit test.

@bazsi bazsi marked this pull request as draft December 18, 2022 19:20
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi bazsi force-pushed the fix-systemd-journal-hang-when-time-is-going-backwards-after-a-boot branch from 333b333 to f062198 Compare December 28, 2022 07:50
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi bazsi force-pushed the fix-systemd-journal-hang-when-time-is-going-backwards-after-a-boot branch from f062198 to 1637615 Compare December 28, 2022 17:20
@bazsi bazsi marked this pull request as ready for review December 28, 2022 17:21
@bazsi bazsi changed the title WIP: Fix systemd journal hang when time is going backwards after a boot Fix systemd journal hang when time is going backwards after a boot Dec 28, 2022
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi bazsi force-pushed the fix-systemd-journal-hang-when-time-is-going-backwards-after-a-boot branch from 1637615 to f933714 Compare December 28, 2022 21:34
@kira-syslogng
Copy link
Contributor

Build FAILURE

@MrAnno
Copy link
Collaborator

MrAnno commented Jan 13, 2023

@kira-syslogng retest this please

We had typedefs and separate variables for various libsystemd related
functions, remove the typedefs as that's a lot of boilerplate.

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
This patch still retains the capability for loading libsystemd.so at runtime,
instead of linking to it specifically, but gets rid off a layer which does
not really provide us too much value.

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
… Glibisms

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…of the journal

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…t boot

This option is similar to "journalctl -b" which resolves an issue around
clocks going backwards accross boots.

Signed-off-by: @TaborKelly
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
@bazsi bazsi force-pushed the fix-systemd-journal-hang-when-time-is-going-backwards-after-a-boot branch from f933714 to 29a2ca3 Compare January 14, 2023 12:46
@bazsi
Copy link
Collaborator Author

bazsi commented Jan 14, 2023

added NEWS file, also updated the PR description to conclude on how we enable the new mode of operation.

@bazsi bazsi added this to the syslog-ng 4.1 milestone Jan 14, 2023
@MrAnno MrAnno self-requested a review January 14, 2023 13:54
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.

Syslog-ng stops logging on console after system time is changed
3 participants