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

wildcard-file: fix crash when flow-controlled driver gets destroyed #293

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

MrAnno
Copy link
Member

@MrAnno MrAnno commented Sep 18, 2024

Previously, directory_monitors were stopped and destroyed in the free() method of WildcardSourceDriver.

This can cause a crash because flow-controlled sources may retain references to their driver (through their ack tracker), and the last unref() call may be executed from a source thread (non-main thread).

Stopping directory monitors in the deinit() method fixes this issue, and it also fixes another issue where the driver would register a new superfluous monitor for the same directory each config revert.

Fixes syslog-ng/syslog-ng#5085 and the mentioned monitor reregistration issue

Previously, directory_monitors were stopped and destroyed in the free()
method of WildcardSourceDriver.

This can cause a crash because flow-controlled sources may retain
references to their driver (through their ack tracker), and the last
unref() call may be executed from a source thread (non-main thread).

Stopping directory monitors in the deinit() method fixes this issue, and it
also fixes another issue where the driver would register a new superfluous
monitor for the same directory each config revert.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
@alltilla alltilla merged commit 80402c6 into axoflow:main Sep 20, 2024
22 checks passed
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.

DirectoryMonitor crashes on config reload if there is a pending job in the queue
2 participants