RE: [milter-greylist] Configuration file reload blocking too many threads
2004-10-26 by attila.bruncsak@itu.int
Hello, manu@... wrote: > That's nice. This could be improved a bit by letting the thread that > calls conf_update return and use the old config. It can be done easily > by tweaking conf_load: > - Remove pthread_join > - Handle a structure containing the attribute and the config > file stream > to the spawned thread that reloads the config, and free the attribute > and close the config file from that thread. > > What do you think? > I moved the creation of the thread from conf_load() to conf_update() and replaced the pthread_join with pthread_detach. The conf_load is called directly from the initial config load as a function and as a thread on config reload. It opens the config file itself no need to pass the file stream. On initial load some locks are used now without real need but they are already correctly initialized so no harm. New config file load is not so frequent but rather significant event, so I decided that the time it takes to load will be sent to syslog even without the debug switched on. See the patch (based on the 1.5.10) attached to this mail. Bests, Attila