Commit f80c0a1e authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Move the reopening of listen sockets down to after handling the child exit.

This makes sure that any panic message from the child is handled and shown
before continuing (or possibly failing).
parent 020c5a62
......@@ -492,17 +492,6 @@ mgt_reap_child(void)
fprintf(stderr, "WAIT 0x%jd\n", (intmax_t)r);
assert(r == child_pid);
/*
* XXX exit mgr if we fail even with retries?
* number of retries? interval?
*/
for (i = 0; i < 3; i++) {
if (MAC_reopen_sockets() == 0)
break;
/* error already logged */
(void)sleep(1);
}
VSB_printf(vsb, "Child (%jd) %s", (intmax_t)r,
status ? "died" : "ended");
if (WIFEXITED(status) && WEXITSTATUS(status)) {
......@@ -549,6 +538,17 @@ mgt_reap_child(void)
MGT_Complain(C_DEBUG, "Child cleanup complete");
/*
* XXX exit mgr if we fail even with retries?
* number of retries? interval?
*/
for (i = 0; i < 3; i++) {
if (MAC_reopen_sockets() == 0)
break;
/* error already logged */
(void)sleep(1);
}
if (child_state == CH_DIED && mgt_param.auto_restart)
mgt_launch_child(NULL);
else if (child_state == CH_DIED)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment