Skip to content

Commit

Permalink
UCP: handle a case of a null cm on the worker.
Browse files Browse the repository at this point in the history
may happen if the list of components that support CM is longer than the
available cms on the host (worker->cms).
  • Loading branch information
alinask committed May 6, 2021
1 parent 63ccf2b commit f728d96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ucp/core/ucp_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ ucp_listen_on_cm(ucp_listener_h listener, const ucp_listener_params_t *params)

for (i = 0; i < num_cms; ++i) {
ucp_cm = &worker->cms[i];
if (ucp_cm->cm == NULL) {
continue;
}

status = uct_listener_create(ucp_cm->cm, addr,
params->sockaddr.addrlen, &uct_params,
&uct_listeners[listener->num_rscs]);
Expand Down
3 changes: 2 additions & 1 deletion src/ucp/wireup/wireup_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ static int ucp_cm_client_try_fallback_cms(ucp_ep_h ep)
ucp_rsc_index_t next_cm_idx = cm_wireup_ep->cm_idx + 1;
uct_worker_cb_id_t prog_id = UCS_CALLBACKQ_ID_NULL;

if (next_cm_idx >= ucp_worker_num_cm_cmpts(worker)) {
if ((next_cm_idx >= ucp_worker_num_cm_cmpts(worker)) ||
(worker->cms[next_cm_idx].cm == NULL)) {
ucs_debug("reached the end of the cms priority list, no cms left to"
" check (sockaddr_cm=%s, cm_idx=%d).",
ucp_context_cm_name(worker->context, cm_wireup_ep->cm_idx),
Expand Down

0 comments on commit f728d96

Please sign in to comment.