Skip to content
Snippets Groups Projects
Commit b345c19c authored by Danny Auble's avatar Danny Auble
Browse files

CRAY - Fix race condition in proctrack cray proctrack_p_plugin_get_pids

parent 553436cb
No related branches found
No related tags found
No related merge requests found
......@@ -282,10 +282,21 @@ int proctrack_p_plugin_get_pids(uint64_t cont_id, pid_t **pids, int *npids)
p = (pid_t *)xmalloc(bufsize);
pidcnt = job_getpidlist((jid_t)cont_id, p, bufsize);
if (pidcnt == -1) {
error("job_getpidlist() failed: %m");
int rc = SLURM_SUCCESS;
/* There is a possiblity for a race condition
where if the last task in the job exits
between job_getpidcnt and job_getpidlist.
That is ok, so just return SUCCESS;
*/
if (errno != ENODATA) {
rc = SLURM_ERROR;
error("job_getpidlist() failed: %m");
}
*pids = NULL;
*npids = 0;
xfree(p);
return SLURM_ERROR;
}
*pids = p;
......
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