Skip to content

Commit ae67fa1

Browse files
author
Ralph Castain
committed
Silence the libevent warning when a proc abnormally terminates by cleaning up the error registrations
1 parent d0c959c commit ae67fa1

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

opal/mca/pmix/pmix112/pmix/src/usock/usock_sendrecv.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
5353
pmix_server_trkr_t *trk;
5454
pmix_rank_info_t *rinfo, *rnext;
5555
pmix_trkr_caddy_t *tcd;
56+
pmix_error_reg_info_t *errreg;
57+
pmix_regevents_info_t *reginfoptr, *regnext;
5658

5759
/* stop all events */
5860
if (peer->recv_ev_active) {
@@ -99,15 +101,22 @@ static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
99101
}
100102
}
101103
}
102-
/* remove this proc from the list of ranks for this nspace */
103-
pmix_list_remove_item(&(peer->info->nptr->server->ranks), &(peer->info->super));
104-
PMIX_RELEASE(peer->info);
105-
/* reduce the number of local procs */
106-
--peer->info->nptr->server->nlocalprocs;
107-
/* do some cleanup as the client has left us */
108-
pmix_pointer_array_set_item(&pmix_server_globals.clients,
104+
/* remove this proc from the list of ranks for this nspace */
105+
pmix_list_remove_item(&(peer->info->nptr->server->ranks), &(peer->info->super));
106+
PMIX_RELEASE(peer->info);
107+
/* reduce the number of local procs */
108+
--peer->info->nptr->server->nlocalprocs;
109+
/* do some cleanup as the client has left us */
110+
pmix_pointer_array_set_item(&pmix_server_globals.clients,
109111
peer->index, NULL);
110-
PMIX_RELEASE(peer);
112+
/* remove all registered event handlers so libevent doesn't complain */
113+
PMIX_LIST_FOREACH_SAFE(reginfoptr, regnext, &pmix_server_globals.client_eventregs, pmix_regevents_info_t) {
114+
if (reginfoptr->peer == peer) {
115+
PMIX_RELEASE(reginfoptr);
116+
break;
117+
}
118+
}
119+
PMIX_RELEASE(peer);
111120
} else {
112121
/* if I am a client, there is only
113122
* one connection we can have */

0 commit comments

Comments
 (0)