SIGCHLD should not interrupt database connection
SIGCHLD should not interrupt database connection

During the XFER_WORK state, the restore-server forks a child process to
fetch the dump file from the dump-server. Meanwhile, the parent process
periodically updates the database with the amount of bytes already
transferred. Since the monitor_child function does not ignore SIGCHLD,
if the child process exits while the parent is communicating with the
database, our empty SIGCHLD handler will run, potentially causing a
syscall to fail with EINTR. This will most likely occur during the
initial database connection, resulting in an error message that looks
the following (the code '4' is EINTR):

AFS.CellCC.Restore:ERROR: DBI connect([...]) failed: Can't connect to
MySQL server on '[...]' (4)

Typically, this scenario would happen when the volume is small enough
(so the transfer does not take a long time) and the communication
between the restore-server and the dump-server is faster than the
communication between the restore-server and the database.

To fix this problem, do not ignore SIGCHLD only when the parent process
is sleeping.

openafs-contrib/cellcc,openafs-contrib/cellcc