Skip to content

Commit 646e919

Browse files
author
Ralph Castain
committed
Protect against infinite loops
Flag that we provided a notification and ignore it if it attempts to come back up. Signed-off-by: Ralph Castain <[email protected]> (cherry picked from commit ea0d70b)
1 parent 87ddfdd commit 646e919

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

orte/orted/pmix/pmix_server_gen.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,17 @@ void pmix_server_notify(int status, orte_process_name_t* sender,
355355
}
356356
}
357357

358+
/* protect against infinite loops by marking that this notification was
359+
* passed down to the server by me */
360+
if (NULL == cd->info) {
361+
cd->info = OBJ_NEW(opal_list_t);
362+
}
363+
val = OBJ_NEW(opal_value_t);
364+
val->key = strdup("orte.notify.donotloop");
365+
val->type = OPAL_BOOL;
366+
val->data.flag = true;
367+
opal_list_append(cd->info, &val->super);
368+
358369
opal_output_verbose(2, orte_pmix_server_globals.output,
359370
"%s NOTIFYING PMIX SERVER OF STATUS %d",
360371
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ret);
@@ -381,6 +392,14 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
381392
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
382393
ORTE_NAME_PRINT(source), code);
383394

395+
/* check to see if this is one we sent down */
396+
OPAL_LIST_FOREACH(val, info, opal_value_t) {
397+
if (0 == strcmp(val->key, "orte.notify.donotloop")) {
398+
/* yep - do not process */
399+
goto done;
400+
}
401+
}
402+
384403
/* a local process has generated an event - we need to xcast it
385404
* to all the daemons so it can be passed down to their local
386405
* procs */
@@ -447,6 +466,7 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
447466
/* maintain accounting */
448467
OBJ_RELEASE(sig);
449468

469+
done:
450470
/* execute the callback */
451471
if (NULL != cbfunc) {
452472
cbfunc(ORTE_SUCCESS, cbdata);

0 commit comments

Comments
 (0)