[syslog-ng] Adding a background thread
Naveen Revanna
raveenr at gmail.com
Fri Dec 21 02:06:15 UTC 2018
Hello syslog-ng developers,
I am planning to add a new thread of execution to syslog-ng. I am seeking
inputs/expert advice for the same.
Motivation: I had previously discussed a problem here where syslog-ng would
hang if dns server is unreachable. The reason this was happening was that
getaddrinfo() would take some time to timeout and all syslog-ng tasks would
pile up resulting in delayed execution which would appear that syslog-ng
has hung.
I took the approach of using getaddrinfo_a() which would do the async
resolution of the address. I have recently come to understand that
getaddrinfo_a() finally calls getaddrinfo() in a separate pthread that it
spawns. This is causing some issues resulting in a crash. The stacktrace is
pointing to problem in glib allocators.
Here is what I am thinking. I will call iv_thread() to create a new thread
as part of the main process. All this thread does is execute a fixed task
(which in my case is to just do address resolution).
I am looking for inputs from you developers for pointers as to what would
be a good place to spawn this thread. This thread would do very minimal
stuff and hope not to have much complexity. Are there things that I should
look out for if we have another thread of execution. Do any of you think it
is bad idea and time consuming process to introduce a new thread to
existing syslog-ng.
I have some understanding of the code and have read a bit about ivykis and
some of it's functions. All I'll be bothering you will be for your
expertise and would be doing the development on my side.
Sorry if I am bothering you in your time with family. Happy Holidays :)
Thanks,
Naveen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20181220/9ae55060/attachment.html>
More information about the syslog-ng
mailing list