Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions opal/mca/pmix/pmix112/pmix/src/usock/usock_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
pmix_server_trkr_t *trk;
pmix_rank_info_t *rinfo, *rnext;
pmix_trkr_caddy_t *tcd;
pmix_error_reg_info_t *errreg;
pmix_regevents_info_t *reginfoptr, *regnext;

/* stop all events */
if (peer->recv_ev_active) {
Expand Down Expand Up @@ -99,15 +101,23 @@ static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
}
}
}
/* remove this proc from the list of ranks for this nspace */
pmix_list_remove_item(&(peer->info->nptr->server->ranks), &(peer->info->super));
PMIX_RELEASE(peer->info);
/* reduce the number of local procs */
--peer->info->nptr->server->nlocalprocs;
/* do some cleanup as the client has left us */
pmix_pointer_array_set_item(&pmix_server_globals.clients,
/* remove this proc from the list of ranks for this nspace */
pmix_list_remove_item(&(peer->info->nptr->server->ranks), &(peer->info->super));
PMIX_RELEASE(peer->info);
/* reduce the number of local procs */
--peer->info->nptr->server->nlocalprocs;
/* do some cleanup as the client has left us */
pmix_pointer_array_set_item(&pmix_server_globals.clients,
peer->index, NULL);
PMIX_RELEASE(peer);
/* remove all registered event handlers so libevent doesn't complain */
PMIX_LIST_FOREACH_SAFE(reginfoptr, regnext, &pmix_server_globals.client_eventregs, pmix_regevents_info_t) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need a lock around accessing the members of this list? I.e., with a name like "globals", does that imply that another thread may be accessing it at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we are in an event and therefore safe from any other thread access

if (reginfoptr->peer == peer) {
pmix_list_remove_item(&pmix_server_globals.client_eventregs, &reginfoptr->super);
PMIX_RELEASE(reginfoptr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per IM discussion -- @rhc54 is going to bring over another change here for removing the item from the list.

break;
}
}
PMIX_RELEASE(peer);
} else {
/* if I am a client, there is only
* one connection we can have */
Expand Down