1
1

Merge pull request #5457 from rhc54/topic/loop

Protect against infinite loops
Этот коммит содержится в:
Ralph Castain 2018-07-19 15:01:33 -07:00 коммит произвёл GitHub
родитель 8a6dc0b211 747253ba00
Коммит e172849039
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

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

@ -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);