@@ -1974,12 +1974,14 @@ static void notifyerror_cbfunc (pmix_status_t status, void *cbdata)
19741974static pmix_status_t server_switchyard (pmix_peer_t * peer , uint32_t tag ,
19751975 pmix_buffer_t * buf )
19761976{
1977- pmix_status_t rc ;
1977+ pmix_status_t rc = PMIX_ERR_NOT_SUPPORTED ;
19781978 int32_t cnt ;
19791979 pmix_cmd_t cmd ;
19801980 pmix_server_caddy_t * cd ;
19811981 pmix_proc_t proc ;
19821982 pmix_buffer_t * reply ;
1983+ pmix_regevents_info_t * reginfo ;
1984+ pmix_peer_events_info_t * prev ;
19831985
19841986 /* retrieve the cmd */
19851987 cnt = 1 ;
@@ -2036,6 +2038,18 @@ static pmix_status_t server_switchyard(pmix_peer_t *peer, uint32_t tag,
20362038 PMIX_PEER_CADDY (cd , peer , tag );
20372039 (void )strncpy (proc .nspace , peer -> info -> nptr -> nspace , PMIX_MAX_NSLEN );
20382040 proc .rank = peer -> info -> rank ;
2041+ /* since the client is finalizing, remove them from any event
2042+ * registrations they may still have on our list */
2043+ PMIX_LIST_FOREACH (reginfo , & pmix_server_globals .events , pmix_regevents_info_t ) {
2044+ PMIX_LIST_FOREACH (prev , & reginfo -> peers , pmix_peer_events_info_t ) {
2045+ if (prev -> peer == peer ) {
2046+ pmix_list_remove_item (& reginfo -> peers , & prev -> super );
2047+ PMIX_RELEASE (prev );
2048+ break ;
2049+ }
2050+ }
2051+ }
2052+ /* now tell the host server */
20392053 if (PMIX_SUCCESS != (rc = pmix_host_server .client_finalized (& proc , peer -> info -> server_object ,
20402054 op_cbfunc , cd ))) {
20412055 PMIX_RELEASE (cd );
0 commit comments