Skip to content

Commit

Permalink
mxqd: Don't let the child check status after fork
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed May 5, 2022
1 parent 9649d5c commit 9aa4258
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,16 +1203,17 @@ static unsigned long start_job(struct mxq_group_list *glist)
job->host_cpu_set_str = mx_cpuset_to_str(&job->host_cpu_set);

pid = fork();
if (pid == 0) {
job->host_pid = getpid();
mx_log_debug("starting reaper process.");
exec_reaper(server, glist, job);
_exit(EX__MAX+1);
}
if (pid < 0) {
mx_log_err("fork: %m");
cpuset_clear_running(&job->host_cpu_set,&server->cpu_set_available);
mxq_unload_job_from_server(server->mysql, job->job_id);
return 0;
} else if (pid == 0) {
job->host_pid = getpid();
mx_log_debug("starting reaper process.");
exec_reaper(server, glist, job);
_exit(EX__MAX+1);
}

gettimeofday(&job->stats_starttime, NULL);
Expand Down

0 comments on commit 9aa4258

Please sign in to comment.