Skip to content

Conversation

HofiOne
Copy link
Collaborator

@HofiOne HofiOne commented Apr 3, 2025

wildcard-file: Added inotify-based regular file change detection using the existing inotify-based directory monitor.

This improves efficiency on OSes like Linux, where only polling was available before, significantly reducing CPU usage while enhancing change detection accuracy.

To enable this feature, inotify kernel support is required, along with monitor-method() set to inotify or auto, and follow-freq() set to 0.

This PR will have a follow-up pair as we have to fix the full-path handling in the file-reader and the directory monitor which is really messy. FIXME notes will be removed in the next round.

Doc PR syslog-ng/syslog-ng.github.io#185

Resolves: #5019

Signed-off-by: Hofi hofione@gmail.com

@HofiOne HofiOne force-pushed the wildcard-file-inotify branch from 15e3640 to b7d0128 Compare April 3, 2025 13:58
@HofiOne HofiOne marked this pull request as ready for review April 3, 2025 16:03
@HofiOne HofiOne force-pushed the wildcard-file-inotify branch 2 times, most recently from 9104fa6 to 0b30985 Compare April 3, 2025 16:22
HofiOne added 10 commits April 11, 2025 15:26
…at cannot be split as it is an event handler callback)

Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
… is set before trying to call it

Signed-off-by: Hofi <hofione@gmail.com>
…obs if its new notified member set to TRUE

This can be used whereas a PollEvents object is required and cannot be NULL, but its functionality is not needed at all, e.g in the file_reader, where the watched file modification events can be detected and delivered in other ways.
Far not the best solution, but PollEvents is too deeply integrated currently, and I did not want to do an even bigger refactor.

Signed-off-by: Hofi <hofione@gmail.com>
…we do it for the directory monitor

Signed-off-by: Hofi <hofione@gmail.com>
… using the poll_events provided ones

Signed-off-by: Hofi <hofione@gmail.com>
…on events

Signed-off-by: Hofi <hofione@gmail.com>
…ot use poll_events

Signed-off-by: Hofi <hofione@gmail.com>
…he reader

Signed-off-by: Hofi <hofione@gmail.com>
@HofiOne HofiOne force-pushed the wildcard-file-inotify branch from 0b30985 to 68b62c7 Compare April 11, 2025 13:27
HofiOne added 3 commits April 11, 2025 15:41
…le to display the real_path in the starting log message

Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: Hofi <hofione@gmail.com>
@HofiOne HofiOne force-pushed the wildcard-file-inotify branch from 68b62c7 to 17a716d Compare April 11, 2025 13:41
@HofiOne HofiOne merged commit 1eddc42 into syslog-ng:develop Apr 11, 2025
29 of 30 checks passed
@HofiOne HofiOne deleted the wildcard-file-inotify branch April 11, 2025 14:02
HofiOne added a commit to syslog-ng/syslog-ng.github.io that referenced this pull request Apr 11, 2025
Changes introduced in, and depends on
syslog-ng/syslog-ng#5315,
syslog-ng/syslog-ng#5312

Signed-off-by: Hofi <hofione@gmail.com>
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.

file-reader supports only polling on linux
2 participants