Skip to content

UCP/WIREUP: Allow EP check during WIREUP phase - #6069

Merged
yosefe merged 1 commit into
openucx:masterfrom
dmitrygx:topic/ucp/wireup_ep_check
Jan 6, 2021
Merged

yosefe merged 1 commit into
openucx:masterfrom
dmitrygx:topic/ucp/wireup_ep_check

Conversation

@dmitrygx

@dmitrygx dmitrygx commented Dec 29, 2020 •

Copy link
Copy Markdown
Member

What

Allow EP check during WIREUP phase, i.e. UCP will do KA during WIREUP pahse.

Why ?

The remote peer could be failed or forcibly closed during WIREUP MSG phase, e.g. as in #6011 issue:

  • server closes EP forcibly after receiving and handling RDMA CM event "CONNECT REQUEST".
  • client receives RDMA CM event "CONNECT RESPONSE".
  • client does rdma_establish() and UCT informs client about connect completion. CM phase is considered as completed on a client side. Server will start WIREUP MSG phase after from CM's conn_notify_cb callback
  • client hangs for a while since neither WIREUP "PRE_REQUEST" message nor RDMA CM event "DISCONNECTED" was received.

Fixes #6011.
Enabling KA by default (#6059) will fix the issue fully.

How ?

Do WIREUP EP check if UCT EP is locally connected or auxiliary UCT EP is not a NULL and supports UCT_IFACE_FLAG_EP_CHECK; otherwise - return UCS_OK.

Comment thread src/ucp/wireup/wireup_ep.c Outdated

if (wireup_ep->flags & UCP_WIREUP_EP_FLAG_LOCAL_CONNECTED) {
return uct_ep_check(wireup_ep->super.uct_ep, flags, comp);
} else if ((wireup_ep->aux_ep != NULL) &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can remove 'else'
BTW, why need to check UCT_IFACE_FLAG_EP_CHECK flag? i would expect UCP keepalive mechanism to check this already

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed
The check EP_CHECK flag is needed, since UCP KA mechanism checks it only for iface which wireup_ep->super.uct_ep belongs to (e.g. next_ep - RC, aux_ep - UD. but UD doesn't have EP_CHECK support)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

so we need to make sure only transports which have CHECK support are used as aux_ep

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

then UD couldn't be used as aux_ep

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok, is it a problem?
BTW need to make sure UCP would really send keepalive on the ep used for wireup messages, and that ep keepalive list is updated when ep configuration changes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done, now doing EP check over UCT if connected, and otherwise - over AUX EP

@dmitrygx

Copy link
Copy Markdown
Member Author

depends on #6080 and #6078

@dmitrygx

dmitrygx commented Jan 1, 2021

Copy link
Copy Markdown
Member Author

/azp run

@dmitrygx

dmitrygx commented Jan 1, 2021

Copy link
Copy Markdown
Member Author

bot:pipe:retest

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@dmitrygx

dmitrygx commented Jan 1, 2021

Copy link
Copy Markdown
Member Author

@hoopoepg could you review pls?

@dmitrygx

dmitrygx commented Jan 2, 2021

Copy link
Copy Markdown
Member Author

re-run tests against the current master, since #6059 was merged

@dmitrygx

dmitrygx commented Jan 2, 2021

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@dmitrygx

dmitrygx commented Jan 2, 2021

Copy link
Copy Markdown
Member Author

bot:pipe:retest

@dmitrygx
dmitrygx force-pushed the topic/ucp/wireup_ep_check branch from fca6775 to 7f21d44 Compare January 2, 2021 23:02
Comment thread src/ucp/core/ucp_ep.c Outdated

void ucp_ep_destroy_internal(ucp_ep_h ep)
{
if (--ep->ref_cnt != 0) {

@Artemy-Mellanox Artemy-Mellanox Jan 3, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This way we leave ucp_ep visible to keepalive_progress but not checkable (ep_check returns timeout). Hence warnings in ucp_ep_do_keepalive().

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This way we leave ucp_ep visible to keepalive_progress but not checkable (ep_check returns timeout). Hence warnings in ucp_ep_do_keepalive().

@Artemy-Mellanox good catch, thank you!
moved this check to ucp_ep_destroy_base() where UCP EP is about to be removed

@dmitrygx dmitrygx added the WIP-DNM Work in progress / Do not review label Jan 4, 2021
@yosefe yosefe removed the WIP-DNM Work in progress / Do not review label Jan 4, 2021
@dmitrygx

dmitrygx commented Jan 4, 2021

Copy link
Copy Markdown
Member Author

@yosefe @Artemy-Mellanox could you review pls?

Comment thread src/ucp/core/ucp_ep.c Resolved
Comment thread src/ucp/core/ucp_worker.c Resolved
Comment thread src/ucp/wireup/select.c Outdated
Comment on lines +364 to +375
!(/* if error handling and keepalive were requested, UCT iface has to
* support peer failure (i.e. UCT_IFACE_FLAG_ERRHANDLE_PEER_FAILURE)
* and either built-in Keep Alive (i.e. UCT_IFACE_FLAG_EP_KEEPALIVE)
* or EP checking (i.e. UCT_IFACE_FLAG_EP_CHECK) */
!ucp_worker_keepalive_is_enabled(worker) ||
!(select_params->ep_init_flags & UCP_EP_INIT_ERR_MODE_PEER_FAILURE) ||
ucp_wireup_check_flags(resource, iface_attr->cap.flags,
UCT_IFACE_FLAG_EP_KEEPALIVE, criteria->title,
ucp_wireup_iface_flags, p, endp - p) ||
ucp_wireup_check_flags(resource, iface_attr->cap.flags,
UCT_IFACE_FLAG_EP_CHECK, criteria->title,
ucp_wireup_iface_flags, p, endp - p)) ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe use a helper function?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added the helper function

return uct_ep_check(wireup_ep->aux_ep, flags, comp);
}

ucs_assert(ucp_worker_iface(worker,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

pls add comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

Comment thread src/ucp/wireup/select.c
Comment on lines +236 to +245
return /* if error handling and keepalive were requested, UCT iface has to
* support peer failure (i.e. UCT_IFACE_FLAG_ERRHANDLE_PEER_FAILURE)
* and either built-in keepalive (i.e. UCT_IFACE_FLAG_EP_KEEPALIVE)
* or EP checking (i.e. UCT_IFACE_FLAG_EP_CHECK) */
!ucp_worker_keepalive_is_enabled(worker) ||
!(select_params->ep_init_flags & UCP_EP_INIT_ERR_MODE_PEER_FAILURE) ||
ucp_wireup_check_flags(resource, flags, UCT_IFACE_FLAG_EP_KEEPALIVE, title,
ucp_wireup_iface_flags, reason, max) ||
ucp_wireup_check_flags(resource, flags, UCT_IFACE_FLAG_EP_CHECK, title,
ucp_wireup_iface_flags, reason, max);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does it mean that every transport we select must support keepalive or ep_check?
it means that before this PR, we could have a case where the user requested err handling mode, but keepalive may not be working because selected transport did not support?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

does it mean that every transport we select must support keepalive or ep_check?

if KA is enabled (now it is by default) and error handling requested, every selected transport has to support built-in KA or ep_check

it means that before this PR, we could have a case where the user requested err handling mode, but keepalive may not be working because selected transport did not support?

yes, this was a case, e.g. for UD before EP_CHECK was introduced

@dmitrygx
dmitrygx force-pushed the topic/ucp/wireup_ep_check branch from b9e33b9 to 389768e Compare January 6, 2021 09:43
@dmitrygx

dmitrygx commented Jan 6, 2021

Copy link
Copy Markdown
Member Author

@yosefe ok to merge?

@yosefe
yosefe merged commit fd8f8b2 into openucx:master Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hang in rcx/test_ucp_sockaddr_destroy_ep_on_err.onesided_client_sforce/7

3 participants