Skip to content
Snippets Groups Projects
Commit 21d9cc1c authored by Carlos Tripiana Montes's avatar Carlos Tripiana Montes Committed by Danny Auble
Browse files

job_container/tmpfs: Fix bug in _create_ns

It can happen that child proc fails at some point, and returns some exit
code different from 0. But parent didn't check this properly, and
finished returning w/o error.

Now, if child fails, parent too. This spanws back the error and we know
this job will have a problem.

Bug 11093
parent eeec6cd2
No related branches found
No related tags found
No related merge requests found
...@@ -635,14 +635,10 @@ static int _create_ns(uint32_t job_id, bool remount) ...@@ -635,14 +635,10 @@ static int _create_ns(uint32_t job_id, bool remount)
goto exit1; goto exit1;
} }
rc = waitpid(cpid, &wstatus, 0); if ((waitpid(cpid, &wstatus, 0) != cpid) || WEXITSTATUS(wstatus)) {
if (rc == -1) {
error("%s: waitpid failed", __func__); error("%s: waitpid failed", __func__);
rc = SLURM_ERROR;
goto exit1; goto exit1;
} else {
if (rc == cpid)
debug3("child exited: %d",
WEXITSTATUS(wstatus));
} }
rc = 0; rc = 0;
......
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