Skip to content

DirectoryMonitor crashes on config reload if there is a pending job in the queue #5085

@HofiOne

Description

@HofiOne

syslog-ng

Version of syslog-ng

4.8

Steps to reproduce

  1. setup a syslog-ng server/client config (e.g. any network based source+destination combo)
  2. read the client input e.g. with a wildcard-source (that is using inotify or kqueue based directory monitoring) and forward the read input to the network destination, like
source s_wfiles {
    wildcard-file(
        base-dir("/path")
        filename-pattern("*.log")
        recursive(no)        
        
        monitor-method("auto")
        monitor-freq(0.001)
        follow-freq(1)
    );
};

destination d_network {
	network(
    		0.0.0.0 port(19999)
    		keep-alive(yes)
	    );
};

log {
	source(s_wfiles);	
	destination(d_network);
	
	flags(flow-control);
};
  1. trigger some log message on the client side, e.g.
echo "<3> Sep  2 14:12:58 hostname logger[44739] 5" >> /path/input.log
echo "<3> Sep  2 14:12:58 hostname logger[44739] 6" >> /path/input.log
  1. stop the server side
  2. trigger again some log message on the client side, e.g.
echo "<3> Sep  2 14:12:58 hostname logger[44739] 7" >> /path/input.log
echo "<3> Sep  2 14:12:58 hostname logger[44739] 8" >> /path/input.log
  1. start the server side
  2. quickly force reload the client side config via syslog-ng-ctl reload

Result

The client will crash in the directory-monitor cleanup

  1. with kqueue based directory monitor
[2024-09-03T11:21:35.146132] Closing log transport fd; thread_id='6173618176', fd='18'
[2024-09-03T11:21:35.146132] Stopping directory monitor; thread_id='6173618176', dir='/Users/hofi/Develop/Balabit/syslog-ng/build/install/var'
iv_fd_kqueue_upload_all: got error 2[No such file or directory]

Screenshot 2024-09-03 at 11 22 32

  1. with inotify based directory monitor
[2024-09-03T14:17:13.768429] Stopping directory monitor; thread_id='140737280923200', dir='/home/hofi/Develop/Balabit/syslog-ng/build/install/var'
[2024-09-03T14:17:13.768429] Free directory monitor; thread_id='140737280923200', dir='/home/hofi/Develop/Balabit/syslog-ng/build/install/var'
iv_fd_epoll_flush_one: got error 2[No such file or directory]

Screenshot 2024-09-03 at 14 34 00

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions