Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0, 1.8.0, 1.7.0
-
None
Description
Daemon::daemonize() was created to allow a process to run sub-processes in the background, without waiting for their immediate termination.
In order for terminated processes to be reaped and not become zombies, the SIGCHLD handler in the parent should be set to IGNORE.
However, doing so in a standard process prevents it from reliably running waitpid(), so many operations that involve forking and waiting for the forked process return code (Such as: Sending e-mail, generating SSL keys, and any functionality using UI::Utils->exec_command() ) become unreliable.
The problem is not easily noticed, since daemonize is currently called only by API::Cdn::dnssec_keys_refresh(), which is being called twice every 5 minutes. Since there are 96 TO workers by default, it takes a few hours until most of the workers get contaminated with a bad SIGCHLD handler.
A proper solution is to use double forking in daemonize().
Attachments
Issue Links
- links to