1
1

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 <rhc@open-mpi.org>
(cherry picked from commit ea0d70bc9396def61545e2ce492a55c4c3aa7772)
Этот коммит содержится в:
Ralph Castain 2018-07-19 13:50:12 -07:00
родитель 508c3f391f
Коммит 50e6e14020

Просмотреть файл

@ -356,6 +356,17 @@ void pmix_server_notify(int status, orte_process_name_t* sender,
}
}
/* protect against infinite loops by marking that this notification was
* passed down to the server by me */
if (NULL == cd->info) {
cd->info = OBJ_NEW(opal_list_t);
}
val = OBJ_NEW(opal_value_t);
val->key = strdup("orte.notify.donotloop");
val->type = OPAL_BOOL;
val->data.flag = true;
opal_list_append(cd->info, &val->super);
opal_output_verbose(2, orte_pmix_server_globals.output,
"%s NOTIFYING PMIX SERVER OF STATUS %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ret);
@ -382,6 +393,14 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(source), code);
/* check to see if this is one we sent down */
OPAL_LIST_FOREACH(val, info, opal_value_t) {
if (0 == strcmp(val->key, "orte.notify.donotloop")) {
/* yep - do not process */
goto done;
}
}
/* a local process has generated an event - we need to xcast it
* to all the daemons so it can be passed down to their local
* procs */
@ -448,6 +467,7 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
/* maintain accounting */
OBJ_RELEASE(sig);
done:
/* execute the callback */
if (NULL != cbfunc) {
cbfunc(ORTE_SUCCESS, cbdata);