Skip to content
Open
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
76 changes: 76 additions & 0 deletions deps/patches/mercury/0007_canceled_events.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
From 061e86519f587308d44e424e02e6b6b208ddafe4 Mon Sep 17 00:00:00 2001
From: Jerome Soumagne <jerome.soumagne@hpe.com>
Date: Mon, 20 Jul 2026 17:14:52 -0500
Subject: [PATCH] HG core: fix handling of canceled event on send unexpected

In rare cases, the underlying provider could return a canceled event
without explicit user cancelation, which would lead to a lingering
recv not canceled (since CANCELED is handled separately from other
error codes). This could have in turn led to a hang until explicit
cancelation was made.
---
src/mercury_core.c | 48 ++++++++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/src/mercury_core.c b/src/mercury_core.c
index 06404586..eb7d2803 100644
--- a/src/mercury_core.c
+++ b/src/mercury_core.c
@@ -4433,30 +4433,36 @@ hg_core_send_input_cb(const struct na_cb_info *callback_info)

if (callback_info->ret == NA_SUCCESS) {
/* Nothing */
- } else if (callback_info->ret == NA_CANCELED) {
- HG_CHECK_SUBSYS_WARNING(rpc,
- hg_atomic_get32(&hg_core_handle->status) & HG_CORE_OP_COMPLETED,
- "Operation was completed");
- HG_LOG_SUBSYS_DEBUG(
- rpc, "NA_CANCELED event on handle %p", (void *) hg_core_handle);
-
- hg_atomic_cas32(&hg_core_handle->ret_status, (int32_t) HG_SUCCESS,
- (int32_t) HG_CANCELED);
- } else { /* All other errors */
- char addr_buf[HG_CORE_ADDR_MAX_SIZE];
- size_t addr_buf_size = sizeof(addr_buf);
+ } else {
int32_t status;

- /* Mark handle as errored */
- status = hg_atomic_or32(&hg_core_handle->status, HG_CORE_OP_ERRORED);
+ if (callback_info->ret == NA_CANCELED) {
+ status = hg_atomic_get32(&hg_core_handle->status);

- /* Keep first non-success ret status */
- hg_atomic_cas32(&hg_core_handle->ret_status, (int32_t) HG_SUCCESS,
- (int32_t) callback_info->ret);
- HG_LOG_SUBSYS_ERROR(rpc, "NA callback returned error (%s, dest=\"%s\")",
- NA_Error_to_string(callback_info->ret),
- hg_core_na_addr_to_string(hg_core_handle->na_class,
- hg_core_handle->na_addr, addr_buf, &addr_buf_size));
+ HG_CHECK_SUBSYS_WARNING(
+ rpc, status & HG_CORE_OP_COMPLETED, "Operation was completed");
+ HG_LOG_SUBSYS_DEBUG(
+ rpc, "NA_CANCELED event on handle %p", (void *) hg_core_handle);
+
+ hg_atomic_cas32(&hg_core_handle->ret_status, (int32_t) HG_SUCCESS,
+ (int32_t) HG_CANCELED);
+ } else { /* All other errors */
+ char addr_buf[HG_CORE_ADDR_MAX_SIZE];
+ size_t addr_buf_size = sizeof(addr_buf);
+
+ /* Mark handle as errored */
+ status =
+ hg_atomic_or32(&hg_core_handle->status, HG_CORE_OP_ERRORED);
+
+ /* Keep first non-success ret status */
+ hg_atomic_cas32(&hg_core_handle->ret_status, (int32_t) HG_SUCCESS,
+ (int32_t) callback_info->ret);
+ HG_LOG_SUBSYS_ERROR(rpc,
+ "NA callback returned error (%s, dest=\"%s\")",
+ NA_Error_to_string(callback_info->ret),
+ hg_core_na_addr_to_string(hg_core_handle->na_class,
+ hg_core_handle->na_addr, addr_buf, &addr_buf_size));
+ }

if (!(status & HG_CORE_OP_CANCELED) &&
!(hg_atomic_get32(&hg_core_handle->flags) & HG_CORE_NO_RESPONSE)) {
2 changes: 1 addition & 1 deletion utils/build.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ ucx=https://github.com/openucx/ucx.git

[patch_versions]
spdk=0001_external_isal_v26.01.patch
mercury=0001_dep_versions.patch,0002_ofi_counters.patch,0003_ofi_auth_key.patch,0004_ucx_connection_reset.patch,0005_ucx_put_flush.patch,0006_ucx_bind_bulk.patch
mercury=0001_dep_versions.patch,0002_ofi_counters.patch,0003_ofi_auth_key.patch,0004_ucx_connection_reset.patch,0005_ucx_put_flush.patch,0006_ucx_bind_bulk.patch,0007_canceled_events.patch
argobots=0001_411e5b344642ebc82190fd8b125db512e5b449d1.diff,0002_bb0c908abfac4bfe37852eee621930634183c6aa.diff
3 changes: 3 additions & 0 deletions utils/rpms/mercury.changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
%changelog
* Tue Sep 01 2026 Jerome Soumagne <jerome.soumagne@hpe.com> - 2.4.1-6
- Add patch to fix handling of canceled events

* Mon Aug 31 2026 Tomasz Gromadzki <tomasz.gromadzki@hpe.com> - 2.4.1-5
- Rebuild to force update of defective packages.
- Restore missing auto-generated runtime dependencies.
Expand Down
2 changes: 1 addition & 1 deletion utils/rpms/package_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export libfabric_version="1.22.0"
export libfabric_release="5${distro_name}"
export libfabric_full="${libfabric_version}-${libfabric_release}"
export mercury_version="2.4.1"
export mercury_release="5${distro_name}"
export mercury_release="6${distro_name}"
export mercury_full="${mercury_version}-${mercury_release}"
export argobots_version="1.2"
export argobots_release="4${distro_name}"
Expand Down
Loading