UCT/API: Clarify capability requirements for purge and error handler - #11849
roiedanino merged 10 commits into
Conversation
|
🤖 Starting review — findings will be posted here when done. |
| support token query, and | ||
| @ref uct_ep_outstanding_purge | ||
| is supported. */ | ||
| #define UCT_IFACE_FLAG_V2_QUERY_TOKEN UCS_BIT(2) /**< @ref uct_iface_query_v2 |
There was a problem hiding this comment.
why remove the uct_ep_outstanding_purge support statement here? rc_mlx5 still sets ep_outstanding_purge under the same DEVX condition that sets this flag, so callers currently rely on this flag to detect purge support. if purge is now advertised differently, pls point to the new flag.
| and @ref uct_ep_query | ||
| support token query. */ | ||
| /* Error handling capabilities */ | ||
| #define UCT_IFACE_FLAG_V2_ERR_HANDLER_INPROGRESS UCS_BIT(3) /**< Supports error handler |
There was a problem hiding this comment.
this flag isn't set by any transport or checked anywhere, and there's no test. is the producer/consumer coming in a follow-up? pls add the transport that reports it (or a test) so the capability is actually observable.
|
Residual coverage gap: No test change accompanies the new flag, and the existing |
|
🤖 Starting review — findings will be posted here when done. |
| ucs_status_t status) | ||
| { | ||
| if (UCS_STATUS_IS_ERR(err_handler_status)) { | ||
| if (err_handler_status != UCS_OK) { |
There was a problem hiding this comment.
The condition changed from UCS_STATUS_IS_ERR(err_handler_status) (i.e. < 0) to err_handler_status != UCS_OK. Since UCS_INPROGRESS == 1 (positive), the old code treated an error handler returning UCS_INPROGRESS as non-fatal, while the new code logs UCS_LOG_LEVEL_FATAL for it. This is the opposite of what the newly added UCT_IFACE_FLAG_V2_ERR_HANDLER_INPROGRESS flag documents ("Supports error handler returning UCS_INPROGRESS"). Impact: a transport/error-handler that returns UCS_INPROGRESS — the exact case the new flag is meant to advertise as valid — would now produce a FATAL failure log. The change also does not consult the new capability flag when deciding fatality, so the flag and the code are inconsistent.
| and @ref uct_ep_query | ||
| support token query. */ | ||
| /* Error handling capabilities */ | ||
| #define UCT_IFACE_FLAG_V2_ERR_HANDLER_INPROGRESS UCS_BIT(3) /**< Supports error handler |
There was a problem hiding this comment.
UCT_IFACE_FLAG_V2_ERR_HANDLER_INPROGRESS is defined but never set by any transport, never read by any consumer, and does not gate the uct_base_iface_failure_log_level change. As is, it has no effect. Either a transport should advertise it and uct_base_iface_failure_log_level should key its UCS_INPROGRESS handling off it, or the flag should be dropped from this PR.
| support token query, and | ||
| @ref uct_ep_outstanding_purge | ||
| is supported. */ | ||
| #define UCT_IFACE_FLAG_V2_QUERY_TOKEN UCS_BIT(2) /**< @ref uct_iface_query_v2 |
There was a problem hiding this comment.
The UCT_IFACE_FLAG_V2_QUERY_TOKEN doc previously stated that uct_ep_outstanding_purge is supported when the flag is set. The PR removes that sentence. rc_mlx5 still both sets UCT_IFACE_FLAG_V2_QUERY_TOKEN and provides ep_outstanding_purge (uct_ib_mlx5_ext_ep_outstanding_purge), so if any caller relied on that documented relationship to gate purge usage, this removes the contract without a replacement. Worth confirming this is intentional and that no consumer keyed purge support off QUERY_TOKEN.
|
Residual coverage gap: no test exercises |
|
🤖 Starting review — findings will be posted here when done. |
| status = uct_rc_mlx5_iface_query_rx_token(tl_iface, iface_attr); | ||
| if (status != UCS_OK) { | ||
| return status; | ||
| } |
There was a problem hiding this comment.
is this intended to disable the feature, or only hide the advertisement? the token query and outstanding-purge paths are still fully implemented in uct_rc_mlx5_iface_query_v2 / uct_rc_mlx5_ep_query_tx_token, so the capability stays reachable but undiscoverable. if the goal is to disable it, should the token-query code be removed/gated too?
| */ | ||
| /* PUT capabilities */ | ||
| #define UCT_IFACE_FLAG_V2_PUT_SGL_ZCOPY UCS_BIT(0) /**< Zero-copy SGL put */ | ||
| /* GET capabilities */ |
There was a problem hiding this comment.
The reworded comment for UCT_IFACE_FLAG_V2_QUERY_TOKEN still lists uct_ep_query token query and uct_ep_outstanding_purge as gated by this flag. Since no transport now sets the flag, and the mechanisms remain active, this documentation may mislead users about what the flag actually guards.
|
🤖 CI Triage Agent — TL;DR: The Full analysisSummary: Root cause: Log line: Implicated commit: [REDACTED:Hex High Entropy String] — Zihao Zhao, "UCT/API: rm in progress flag and revert query" (2026-08-28) File: src/uct/api/uct_def.h:578 Suggested fix: In
Avoid Related: PR #11849 (this PR), PR #11823 (prior "rc support in progress error handler"), PR #11277 / #11668 (earlier users of the token-query flag)
|
| and @ref uct_ep_query | ||
| support token query. */ | ||
| /* Error handling capabilities */ | ||
| #define UCT_IFACE_FLAG_V2_ERR_HANDLER_INPROGRESS UCS_BIT(3) /**< Supports error handler |
There was a problem hiding this comment.
@evgeny-leksikov suggested:
we dont need extra UCT_IFACE_FLAG_V2_ERR_HANDLER_INPROGRESS, this is consequence of tokens + outstanding purge support
| support token query, and | ||
| @ref uct_ep_outstanding_purge | ||
| is supported. */ | ||
| #define UCT_IFACE_FLAG_V2_QUERY_TOKEN UCS_BIT(2) /**< @ref uct_iface_query_v2 |
There was a problem hiding this comment.
@evgeny-leksikov suggested:
All three functionalities can be covered in single flag. Just need to mention it in doc
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
| @ref uct_iface_query_v2 and | ||
| @ref uct_ep_query, | ||
| outstanding purge through | ||
| @ref uct_ep_outstanding_purge, and |
There was a problem hiding this comment.
Remove 'an error handler...'.
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
| * This routine should be called only after the error handler for @a ep returns | ||
| * @ref UCS_INPROGRESS. It can be used only if the interface supports | ||
| * @c UCT_IFACE_FLAG_V2_QUERY_TOKEN. | ||
| * @ref uct_ep_outstanding_purge_params_t::cb is invoked once for each | ||
| * undelivered outstanding operation, in the original endpoint posting order. |
There was a problem hiding this comment.
| * This routine should be called only after the error handler for @a ep returns | |
| * @ref UCS_INPROGRESS. It can be used only if the interface supports | |
| * @c UCT_IFACE_FLAG_V2_QUERY_TOKEN. | |
| * @ref uct_ep_outstanding_purge_params_t::cb is invoked once for each | |
| * undelivered outstanding operation, in the original endpoint posting order. | |
| * @ref uct_ep_outstanding_purge_params_t::cb is invoked once for each | |
| * undelivered outstanding operation, in the original endpoint posting order. | |
| * @note This routine should be called only after the error handler for @a ep returns | |
| * @ref UCS_INPROGRESS. It can be used only if the interface supports | |
| * @c UCT_IFACE_FLAG_V2_QUERY_TOKEN. |
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
|
🤖 CI Triage Agent — TL;DR: The Full analysisSummary: Root cause: Not an environment or timing issue — a hard documentation error: Commit * @note If the callback returns @ref UCS_INPROGRESS, user should purge
* outstanding operations with @ref uct_ep_outstanding_purge.
Note the failure is platform-independent — the aarch64/ctyunos2507 leg just happens to be the one reported; every leg running Implicated commit: File: Suggested fix: Point the reference at a symbol that exists in the doxygen-visible API, e.g.: * @note If the callback returns @ref UCS_INPROGRESS, the user is responsible for
* cancelling the outstanding operations on the endpoint (see
* @ref uct_ep_pending_purge and @ref uct_ep_flush with
* @ref UCT_FLUSH_FLAG_CANCEL).If you deliberately want to mention a routine that is not yet part of the public documented API, write it without Related: PR #11849 (this PR), PR #11829 (UCT/IB/MLX5: support in progress error handler), PR #11580 (UCT: Add outstanding operation extraction support — where the
|
|
🤖 Starting review — findings will be posted here when done. |
| * and cancel all possible outstanding operations prior closing a UCT | ||
| * endpoint. | ||
| * | ||
| * @note If the callback returns @ref UCS_INPROGRESS, user should purge |
There was a problem hiding this comment.
minor: use @ref uct_ep_outstanding_purge here to match the @ref style used everywhere else in these headers and generate the doc link.
| * undelivered outstanding operation, in the original endpoint posting order. | ||
| * | ||
| * @note This routine should be called only after the error handler for @a ep | ||
| * returns @ref UCS_INPROGRESS. It can be used only if the interface |
There was a problem hiding this comment.
minor: use @ref UCT_IFACE_FLAG_V2_QUERY_TOKEN instead of @c for consistency with the rest of the file.
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
What?
Clarify the API requirements for error-handler in-progress handling and outstanding operation purge.
Why?
Ensure that UCS_INPROGRESS and outstanding purge are used only by interfaces supporting UCT_IFACE_FLAG_V2_QUERY_TOKEN.
How?
Restrict returning UCS_INPROGRESS to interfaces supporting
UCT_IFACE_FLAG_V2_QUERY_TOKEN.Restrict uct_ep_outstanding_purge() to interfaces supporting
UCT_IFACE_FLAG_V2_QUERY_TOKEN.Require the RX token and callback bits in the purge field mask.