Skip to content
Snippets Groups Projects
Commit 4a636447 authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files
parent bb21c491
No related branches found
No related tags found
No related merge requests found
......@@ -744,8 +744,9 @@ _wait_for_any_task(slurmd_job_t *job, bool waitflag)
if (pid == -1) {
if (errno == ECHILD) {
debug("No child processes");
completed = -1;
break;
if (completed == 0)
completed = -1;
goto done;
} else if (errno == EINTR) {
debug("wait3 was interrupted");
continue;
......@@ -753,6 +754,8 @@ _wait_for_any_task(slurmd_job_t *job, bool waitflag)
debug("Unknown errno %d", errno);
continue;
}
} else if (pid == 0) { /* WNOHANG and no pids available */
goto done;
}
/* See if the pid matches that of one of the tasks */
......@@ -792,6 +795,7 @@ _wait_for_any_task(slurmd_job_t *job, bool waitflag)
} while ((pid > 0) && !waitflag);
done:
return completed;
}
......@@ -814,14 +818,14 @@ _wait_for_all_tasks(slurmd_job_t *job)
for (i = 0; i < tasks_left; ) {
int rc;
rc = _wait_for_any_task(job, true);
if (rc == -1) /* Got ECHILD */
break;
i += rc;
if (i < job->ntasks) {
rc = _wait_for_any_task(job, false);
if (rc == -1) /* Got ECHILD */
break;
if (rc != -1) {
i += rc;
if (i < job->ntasks) {
rc = _wait_for_any_task(job, false);
if (rc != -1) {
i += rc;
}
}
}
while (_send_pending_exit_msgs(job)) {;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment