@@ -51,7 +51,8 @@ PMIX_EXPORT pmix_status_t PMIx_Notify_event(pmix_status_t status, const pmix_pro
5151 return PMIX_ERR_INIT ;
5252 }
5353
54- if (PMIX_PEER_IS_SERVER (pmix_globals .mypeer ) || PMIX_PEER_IS_TOOL (pmix_globals .mypeer )) {
54+ if (PMIX_PEER_IS_SERVER (pmix_globals .mypeer ) ||
55+ PMIX_PEER_IS_TOOL (pmix_globals .mypeer )) {
5556 PMIX_RELEASE_THREAD (& pmix_global_lock );
5657
5758 pmix_output_verbose (2 , pmix_server_globals .event_output ,
@@ -273,8 +274,10 @@ static pmix_status_t notify_server_of_event(pmix_status_t status, const pmix_pro
273274
274275 if (PMIX_RANGE_PROC_LOCAL != range && NULL != msg ) {
275276 /* if this is a "lost-connection" event, then there is no
276- * server to pass it to! */
277- if (PMIX_ERR_LOST_CONNECTION == status ) {
277+ * server to pass it to! Likewise, we don't pass it to
278+ * ourselves */
279+ if (PMIX_ERR_LOST_CONNECTION == status ||
280+ pmix_globals .mypeer == pmix_client_globals .myserver ) {
278281 PMIX_RELEASE (msg );
279282 goto local ;
280283 }
@@ -391,11 +394,15 @@ static void cycle_events(int sd, short args, void *cbdata)
391394
392395 /* if the caller indicates that the chain is completed,
393396 * or we completed the "last" event */
394- if (PMIX_EVENT_ACTION_COMPLETE == chain -> interim_status
395- || PMIX_EVENT_ORDER_LAST_OVERALL == chain -> evhdlr -> precedence || chain -> endchain ) {
397+ if (PMIX_EVENT_ACTION_COMPLETE == chain -> interim_status ||
398+ PMIX_EVENT_ORDER_LAST_OVERALL == chain -> evhdlr -> precedence || chain -> endchain ) {
396399 if (PMIX_EVENT_ACTION_COMPLETE == chain -> interim_status ) {
397400 chain -> interim_status = PMIX_SUCCESS ;
398401 }
402+ if (chain -> evhdlr -> oneshot ) {
403+ /* remove this handler */
404+ pmix_deregister_event_hdlr (chain -> evhdlr -> index , NULL );
405+ }
399406 goto complete ;
400407 }
401408 item = NULL ;
@@ -409,8 +416,7 @@ static void cycle_events(int sd, short args, void *cbdata)
409416 } else {
410417 item = & chain -> evhdlr -> super ;
411418 }
412- while (pmix_list_get_end (& pmix_globals .events .single_events )
413- != (item = pmix_list_get_next (item ))) {
419+ while (pmix_list_get_end (& pmix_globals .events .single_events ) != (item = pmix_list_get_next (item ))) {
414420 nxt = (pmix_event_hdlr_t * ) item ;
415421 if (nxt -> codes [0 ] == chain -> status && pmix_notify_check_range (& nxt -> rng , & chain -> source )
416422 && pmix_notify_check_affected (nxt -> affected , nxt -> naffected , chain -> affected ,
@@ -499,8 +505,7 @@ static void cycle_events(int sd, short args, void *cbdata)
499505 } else if (NULL == item ) {
500506 item = & chain -> evhdlr -> super ;
501507 }
502- if (pmix_list_get_end (& pmix_globals .events .default_events )
503- != (item = pmix_list_get_next (item ))) {
508+ if (pmix_list_get_end (& pmix_globals .events .default_events ) != (item = pmix_list_get_next (item ))) {
504509 nxt = (pmix_event_hdlr_t * ) item ;
505510 /* if this event handler provided a range, check to see if
506511 * the source fits within it */
@@ -687,7 +692,8 @@ void pmix_invoke_local_event_hdlr(pmix_event_chain_t *chain)
687692 }
688693 }
689694 if (!found ) {
690- pmix_output_verbose (8 , pmix_client_globals .event_output , "%s %s:%d" ,
695+ pmix_output_verbose (8 , pmix_client_globals .event_output ,
696+ "%s Ignoring event %s:%d" ,
691697 PMIX_NAME_PRINT (& pmix_globals .myid ), __FILE__ , __LINE__ );
692698 goto complete ;
693699 }
@@ -1089,6 +1095,10 @@ static void _notify_client_event(int sd, short args, void *cbdata)
10891095 if (PMIX_CHECK_PROCID (& cd -> source , & pr -> peer -> info -> pname )) {
10901096 continue ;
10911097 }
1098+ /* don't notify ourselves - we handle this internally */
1099+ if (PMIX_CHECK_PROCID (& pmix_globals .myid , & pr -> peer -> info -> pname )) {
1100+ continue ;
1101+ }
10921102 /* if we have already notified this client, then don't do it again */
10931103 matched = false;
10941104 PMIX_LIST_FOREACH (nm , & trk , pmix_namelist_t ) {
@@ -1353,8 +1363,10 @@ void pmix_event_timeout_cb(int fd, short flags, void *arg)
13531363 PMIX_RETAIN (ch );
13541364
13551365 /* process this event thru the regular channels */
1356- if (PMIX_PEER_IS_SERVER (pmix_globals .mypeer ) && !PMIX_PEER_IS_LAUNCHER (pmix_globals .mypeer )) {
1357- pmix_server_notify_client_of_event (ch -> status , & ch -> source , ch -> range , ch -> info , ch -> ninfo ,
1366+ if (PMIX_PEER_IS_SERVER (pmix_globals .mypeer ) &&
1367+ !PMIX_PEER_IS_LAUNCHER (pmix_globals .mypeer )) {
1368+ pmix_server_notify_client_of_event (ch -> status , & ch -> source , ch -> range ,
1369+ ch -> info , ch -> ninfo ,
13581370 ch -> final_cbfunc , ch -> final_cbdata );
13591371 } else {
13601372 pmix_invoke_local_event_hdlr (ch );
@@ -1427,6 +1439,7 @@ static void sevcon(pmix_event_hdlr_t *p)
14271439 p -> name = NULL ;
14281440 p -> index = UINT_MAX ;
14291441 p -> precedence = PMIX_EVENT_ORDER_NONE ;
1442+ p -> oneshot = false;
14301443 p -> locator = NULL ;
14311444 p -> rng .range = PMIX_RANGE_UNDEF ;
14321445 p -> rng .procs = NULL ;
0 commit comments