Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-16170 cart: refine corpc fail handling for CRT_RPC_FLAG_CO_FAILOUT #15572

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/cart/crt_corpc.c
daltonbohning marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2023 Intel Corporation.
* (C) Copyright 2016-2024 Intel Corporation.
liuxuezhao marked this conversation as resolved.
Show resolved Hide resolved
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -777,6 +777,7 @@ crt_corpc_req_hdlr(struct crt_rpc_priv *rpc_priv)
struct crt_opc_info *opc_info;
struct crt_corpc_ops *co_ops;
bool ver_match;
bool co_failout = false;
int i, rc = 0;

co_info = rpc_priv->crp_corpc_info;
Expand Down Expand Up @@ -906,18 +907,18 @@ crt_corpc_req_hdlr(struct crt_rpc_priv *rpc_priv)
}

forward_done:
if (rc != 0 && rpc_priv->crp_flags & CRT_RPC_FLAG_CO_FAILOUT) {
crt_corpc_complete(rpc_priv);
goto out;
}
if (rc != 0 && rpc_priv->crp_flags & CRT_RPC_FLAG_CO_FAILOUT)
co_failout = true;

/* NOOP bcast (no child and root excluded) */
if (co_info->co_child_num == 0 && co_info->co_root_excluded)
if (co_info->co_child_num == 0 && (co_info->co_root_excluded || co_failout))
crt_corpc_complete(rpc_priv);

if (co_info->co_root_excluded == 1) {
if (co_info->co_root_excluded == 1 || co_failout) {
if (co_info->co_grp_priv->gp_self == co_info->co_root) {
/* don't return error for root */
/* don't return error for root to avoid RPC_DECREF in
* fail case in crt_req_send.
*/
rc = 0;
}
D_GOTO(out, rc);
Expand Down
2 changes: 1 addition & 1 deletion src/cart/crt_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ crt_req_send(crt_rpc_t *req, crt_cb_t complete_cb, void *arg)
/* failure already reported through complete cb */
if (complete_cb != NULL)
rc = 0;
} else if (!crt_rpc_completed(rpc_priv)) {
} else {
RPC_DECREF(rpc_priv);
}
}
Expand Down
Loading