Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maintain correct ref count of child jobs #2099

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/mca/state/dvm/state_dvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ static void check_complete(int fd, short args, void *cbdata)

static void cleanup_job(int sd, short args, void *cbdata)
{
pmix_proc_t *nptr;
prte_job_t *parent;
prte_state_caddy_t *caddy = (prte_state_caddy_t *) cbdata;
PRTE_HIDE_UNUSED_PARAMS(sd, args);

Expand All @@ -873,6 +875,16 @@ static void cleanup_job(int sd, short args, void *cbdata)
prte_plm.terminate_orteds();
}
if (NULL != caddy->jdata) {
/* if the job had a spawn parent remove it from the parents child list */
if (prte_get_attribute(&caddy->jdata->attributes, PRTE_JOB_LAUNCH_PROXY, (void **) &nptr, PMIX_PROC)) {
if(NULL != (parent = prte_get_job_data_object(nptr->nspace)) &&
!PMIX_CHECK_NSPACE(parent->nspace, PRTE_PROC_MY_NAME->nspace)){
pmix_list_remove_item(&parent->children, &caddy->jdata->super);
/* We retained the jdata before adding it to the list - maintain ref count */
PMIX_RELEASE(caddy->jdata);
}
PMIX_PROC_RELEASE(nptr);
}
PMIX_RELEASE(caddy->jdata);
}
PMIX_RELEASE(caddy);
Expand Down
8 changes: 1 addition & 7 deletions src/runtime/prte_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ static void prte_job_destruct(prte_job_t *job)
prte_app_context_t *app;
int n;
prte_timer_t *evtimer;
prte_job_t *child_jdata = NULL;
pmix_list_t *cache = NULL;

if (NULL == job) {
Expand Down Expand Up @@ -580,12 +579,7 @@ static void prte_job_destruct(prte_job_t *job)

PMIX_DATA_BUFFER_DESTRUCT(&job->launch_msg);

/* Clear the child list before destroying the list */
PMIX_LIST_FOREACH(child_jdata, &job->children, prte_job_t)
{
pmix_list_remove_item(&job->children, &child_jdata->super);
}

/* Release the child list - we retained the child jobs before adding them to the list*/
PMIX_LIST_DESTRUCT(&job->children);

if (NULL != job->session_dir) {
Expand Down
Loading