Skip to content

Commit

Permalink
Merge pull request #7773 from dmitrygx/topic/ucp/flush_v1_12
Browse files Browse the repository at this point in the history
UCP/FLUSH: Fix error handling from UCT EP flush [v1.12.x]
  • Loading branch information
dmitrygx authored Dec 8, 2021
2 parents 99aa831 + 8ab087e commit c687dfc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/ucp/rma/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,22 @@ static unsigned ucp_ep_flush_resume_slow_path_callback(void *arg)

ucs_status_t ucp_ep_flush_progress_pending(uct_pending_req_t *self)
{
ucp_request_t *req = ucs_container_of(self, ucp_request_t, send.uct);
ucp_request_t *req = ucs_container_of(self, ucp_request_t, send.uct);
ucp_lane_index_t lane = req->send.lane;
ucp_ep_h ep = req->send.ep;
ucp_ep_h ep = req->send.ep;
ucs_status_t status;
int completed;

ucs_assert(!(req->flags & UCP_REQUEST_FLAG_COMPLETED));

status = uct_ep_flush(ep->uct_eps[lane], req->send.flush.uct_flags,
&req->send.state.uct_comp);
ucs_trace("flushing ep %p lane[%d]: %s", ep, lane,
ucs_trace("flushing ep %p lane[%d]=%p: %s", ep, lane, ep->uct_eps[lane],
ucs_status_string(status));
if (status == UCS_OK) {
--req->send.state.uct_comp.count; /* UCT endpoint is flushed */
} else if (UCS_STATUS_IS_ERR(status) && (status != UCS_ERR_NO_RESOURCE)) {
ucp_ep_flush_error(req, status);
}

/* since req->flush.pend.lane is still non-NULL, this function will not
Expand All @@ -225,18 +227,16 @@ ucs_status_t ucp_ep_flush_progress_pending(uct_pending_req_t *self)
req, 0, &req->send.flush.prog_id);
}

if ((status == UCS_OK) || (status == UCS_INPROGRESS)) {
if (status == UCS_ERR_NO_RESOURCE) {
return UCS_ERR_NO_RESOURCE;
} else if (!UCS_STATUS_IS_ERR(status)) {
/* flushed callback might release the request */
if (!completed) {
req->send.lane = UCP_NULL_LANE;
}
return UCS_OK;
} else if (status == UCS_ERR_NO_RESOURCE) {
return UCS_ERR_NO_RESOURCE;
} else {
ucp_ep_flush_error(req, status);
return UCS_OK;
}

return UCS_OK;
}

void ucp_ep_flush_completion(uct_completion_t *self)
Expand Down

0 comments on commit c687dfc

Please sign in to comment.