UCP/CORE: Increment completion count before calling uct_ep_flush#7332
Merged
dmitrygx merged 1 commit intoopenucx:masterfrom Sep 3, 2021
Merged
UCP/CORE: Increment completion count before calling uct_ep_flush#7332dmitrygx merged 1 commit intoopenucx:masterfrom
dmitrygx merged 1 commit intoopenucx:masterfrom
Conversation
a21f072 to
df16fe6
Compare
yosefe
reviewed
Sep 2, 2021
|
|
||
| out_comp_count_dec: | ||
| --req->send.state.uct_comp.count; | ||
| ucs_assert(req->send.state.uct_comp.count == 0); |
Contributor
There was a problem hiding this comment.
why assert == 0, are we use it started with 0? maybe assert >= 0?
Member
Author
There was a problem hiding this comment.
yes, it should be either 0 or 1
src/ucp/core/ucp_worker.c
Outdated
| return UCS_OK; | ||
| } else if (status == UCS_ERR_NO_RESOURCE) { | ||
| return UCS_ERR_NO_RESOURCE; | ||
| goto out_comp_count_dec; |
Contributor
There was a problem hiding this comment.
we cannot touch request after calling ucp_worker_discard_uct_ep_flush_comp
maybe
if (status == UCS_INPROGRESS) {
return status; // or goto out
}
--req->send.state.uct_comp.count;
if (status != UCS_ERR_NO_RESOURCE) {
uct_completion_update_status(&req->send.state.uct_comp, status);
ucp_worker_discard_uct_ep_flush_comp(&req->send.state.uct_comp);
status = UCS_OK;
}
return status;
return status;
c952e33 to
38dbfcd
Compare
yosefe
reviewed
Sep 2, 2021
src/ucp/core/ucp_worker.c
Outdated
| --req->send.state.uct_comp.count; | ||
| ucs_assert(req->send.state.uct_comp.count == 0); | ||
|
|
||
| if (status != UCS_ERR_NO_RESOURCE) { |
Contributor
There was a problem hiding this comment.
a slight better suggestion:
if (status == NO_RESOURCE) {
return NO_RESOURCE;
}
uct_completion_update_status(&req->send.state.uct_comp, status);
ucp_worker_discard_uct_ep_flush_comp(&req->send.state.uct_comp);
return UCS_OK
38dbfcd to
a390687
Compare
yosefe
approved these changes
Sep 3, 2021
Contributor
|
Since #6933 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Increment completion count before calling
uct_ep_flush().Why ?
Fixes the following assertion in UD EP flush which expects that the completion counter > 0.
How ?
uct_ep_flush().status == UCS_OKwas returned fromuct_ep_flush().status == UCS_INPROGRESSwas returned fromuct_ep_flush().