Repository navigation
UCP/AM: Drop AM data if rx ep is closed - #5899
Conversation
| } | ||
|
|
||
| ep_ext = ucp_ep_ext_proto(ep); | ||
|
|
There was a problem hiding this comment.
remove the empty line or don't need alignment by =
There was a problem hiding this comment.
remove the empty line or don't need the alignment by =
There was a problem hiding this comment.
i'll remove the line
| return; | ||
| } | ||
|
|
||
| if (ucs_unlikely(!ucs_list_is_empty(&ep_ext->am.started_ams))) { |
There was a problem hiding this comment.
if I'm not mistaken we use likely/unlikely only at fast path
| size_t remaining; | ||
| uint64_t recv_flags; | ||
|
|
||
| ep = ucp_worker_get_ep_by_id(worker, first_hdr->super.ep_id); |
| } | ||
|
|
||
| ep_ext = ucp_ep_ext_proto(ep); | ||
|
|
There was a problem hiding this comment.
remove the empty line or don't need alignment by =
| ucp_ep_h ep; | ||
| void *hdr; | ||
|
|
||
| ep = ucp_worker_get_ep_by_id(worker, rts->super.sreq.ep_id); |
| receiver().progress(); | ||
| if (m_am_received) { | ||
| request_wait(sreq); | ||
| UCS_TEST_SKIP_R("received all AMs before ep close"); |
| } | ||
|
|
||
| ep_ext = ucp_ep_ext_proto(ep); | ||
|
|
There was a problem hiding this comment.
remove the empty line or don't need the alignment by =
| ucp_ep_h ep; | ||
| void *hdr; | ||
|
|
||
| ep = ucp_worker_get_ep_by_id(worker, rts->super.sreq.ep_id); |
There was a problem hiding this comment.
can initialize along with declaration?
| size_t remaining; | ||
| uint64_t recv_flags; | ||
|
|
||
| ep = ucp_worker_get_ep_by_id(worker, first_hdr->super.ep_id); |
There was a problem hiding this comment.
can initialize along with declaration?
| void ucp_am_ep_cleanup(ucp_ep_h ep) | ||
| { | ||
| ucp_ep_ext_proto_t *ep_ext = ucp_ep_ext_proto(ep); | ||
| ucp_recv_desc_t *first_rdesc, *tmp, *mid_rdesc; |
There was a problem hiding this comment.
can have only:
ucp_recv_desc_t *rdesc, *tmp_rdesc;
and use rdesc and tmp_rdesc for first/middle fragments processing
| ucp_ep_ext_proto_t *ep_ext; | ||
| ucs_status_t status; | ||
|
|
||
| if (ucs_unlikely(!ucp_am_ep_is_valid(ep))) { |
There was a problem hiding this comment.
btw, what if this is the last fragment received?
I guess, we could process it and report to a user, if it is not a REPLY proto.
There was a problem hiding this comment.
imo, this would make code more complicated (need to process the message before dropping) while does not provide valuable benefit
|
@yosefe, please review |
| return ((ep != NULL) && | ||
| !(ep->flags & (UCP_EP_FLAG_CLOSED | UCP_EP_FLAG_FAILED))); |
There was a problem hiding this comment.
maybe remove ep from ptr map before closed? avoid branch
@evgeny-leksikov
There was a problem hiding this comment.
do you mean directly from ucp_ep_close_nb and before request is completed?
There was a problem hiding this comment.
IIRC we don't have any EPs wire exchanges which can't be dropped after EP started closing, so should work
There was a problem hiding this comment.
should I do it here, or it is a separate PR?
| { | ||
| test_ucp_am_nbx *self = reinterpret_cast<test_ucp_am_nbx*>(arg); | ||
| self->m_am_received = true; | ||
|
|
| } | ||
|
|
||
| EXPECT_EQ(rx_expected, m_am_received); | ||
|
|
|
bot:pipe:retest |
|
|
||
| #define UCP_WORKER_GET_EP_BY_ID(_worker, _ep_id, _str, _action) \ | ||
| ({ \ | ||
| ucp_ep_h __ep = ucp_worker_get_ep_by_id(_worker, _ep_id); \ |
There was a problem hiding this comment.
and i think ucp_worker_get_ep_by_id fails on assert if NULL?
There was a problem hiding this comment.
no, it is ucs_assertv((ep == NULL) || (ep->worker == worker)
| ((__ep)->flags & (UCP_EP_FLAG_CLOSED | \ | ||
| UCP_EP_FLAG_FAILED)))) { \ |
There was a problem hiding this comment.
remove from map during ep_close/fail
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| { | ||
| ucp_ep_h ep = ucp_worker_get_ep_by_id(worker, id); | ||
|
|
||
| if (ucs_likely(ep && !(ep->flags & |
| if (ucs_unlikely(_ep == NULL)) { \ | ||
| ucs_trace_data("worker %p: drop AM %s on closed/failed ep %p", \ | ||
| _worker, _str, __ep); \ | ||
| _worker, _str, _ep); \ |
There was a problem hiding this comment.
change log message to remote "AM"
There was a problem hiding this comment.
can you please clarify?
|
@dmitrygx, do you have other comments? |
- If single fragment AM received without UCP_AM_SEND_REPLY flag it should be delivered to the user even if the corresponding rx ep is closed/failed. - If single fragment AM received with UCP_AM_SEND_REPLY flag it should be droppped if the corresponding rx ep is closed/failed, because reply ep can not be provided in the data callback. - If some fragment of multi-fragmented AM received and the corresponding rx ep is closed/failed, this fragment should be dropped regardless of send AM flags (no way to assemble a message without aux info storedd in ep extension) - If AM RTS is received and the corresponding rx ep is closed/failed, this RTS should be droppped and ATS with EP_TIMEOUT should be sent back to the sender.
4ec26d1 to
ee224c5
Compare
|
bot:pipe:retest |
|
bot:pipe:retest |
|
issue is #5978 bot:pipe:retest |
|
bot:pipe:retest |
1 similar comment
|
bot:pipe:retest |
What
should be delivered to the user even if the corresponding rx ep is
closed/failed.
should be droppped if the corresponding rx ep is closed/failed,
because reply ep can not be provided in the data callback.
is closed/failed, this fragment should be dropped regardless of send AM flags
(no way to assemble a message without aux info storedd in ep extension)
this RTS should be droppped and ATS with EP_TIMEOUT should be sent
back to the sender.
Why ?
Proper error handling