已开启
Destroy Endpoint channels when configuration cleanup fails #241
KaranocaVe创建于 1 天前
Destroy Endpoint channels when configuration cleanup fails #241
已开启
合并受阻
1 天前 创建了 pull request,commit 632d14ae
1 天前 关联了issue:Endpoint multi-channel creation can leak channels after config cleanup fails
1 天前 关联了issue:Endpoint multi-channel creation can leak channels after config cleanup fails
atomgit-bot
1 天前 评论:
1 天前 评论:
变更摘要
本 PR 修复 HcommCreateSharedChannels 在通道创建成功后配置销毁失败的资源泄漏问题。改动位于 src/aicore/hcomm/host/hcomm_host_impl.h:原先该函数直接返回 DestroyChannelConfig 的结果,一旦 HcommChannelConfigDestroy 失败便直接返回错误,已创建的 channels 无法被释放。现在改为在配置销毁失败时尝试调用 HcommChannelDestroy 释放 channels,并对二级清理失败记录日志,同时保留配置销毁的原始返回值作为最终结果。
主要改动
- 配置销毁结果改为显式保存: 将
DestroyChannelConfig(config, DlHcommApi::HcommChannelConfigDestroy, "HcommChannelConfigDestroy")的返回值保存到destroyRet,不再直接作为函数返回值。 - 失败路径新增通道清理: 当
destroyRet != HCCL_SUCCESS时,调用DlHcommApi::HcommChannelDestroy(channels, channelNum)尝试销毁已创建的 channels,避免句柄泄漏。 - 二级清理失败日志: 若
HcommChannelDestroy同样未返回HCCL_SUCCESS,通过ASC_CPU_LOG_ERROR以[ERROR] [%s] cleanup HcommChannelDestroy failed, ret[%d].格式记录该清理错误及返回码。 - 返回值语义保持: 清理分支最终仍返回原始的
destroyRet,成功路径则显式返回HCCL_SUCCESS,保持配置销毁失败结果不被覆盖。


不准确?
atomgit-bot
1 天前 评论:
1 天前 评论:
1 天前 添加了label:cann-cla/yes
CANN-robot
1 天前 评论:
1 天前 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| src | ❌ (0/2)(You can also ask: bluesky901, zhanghao_0689, qin437231, 黄金华, 诸葛洵) | ❌ (0/1)(You can also ask: chenma, 石楠翔, 肖婷, 苏建加, changxianyu) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


CANN-robot
1 天前 评论:
1 天前 评论:
KaranocaVe
1 天前 评论:
1 天前 评论:
/compile


1 天前 预合并成功(commit_id: 46c72f148537bf12239dbf75d661d84098c63f30)
CANN-robot
1 天前 评论:
1 天前 评论:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


1 天前 添加了label:ci-pipeline-running
1 天前 删除了label:ci-pipeline-running
1 天前 添加了label:ci-pipeline-passed
Destroy Endpoint channels when configuration cleanup fails
When
HcommChannelCreateWithConfigsucceeds butHcommChannelConfigDestroyfails, the EndpointMakeMultiChannelHandlepath returns an error without destroying the channels and without returning a handle. The caller cannot release those channels.Attempt
HcommChannelDestroyon this failure path, log a secondary cleanup error, and preserve the configuration-destroy result. The focused Host regression probe passes the injected configuration-destroy failure, an injected channel-cleanup failure, and the normal create/destroy control.关联 Issue: https://gitcode.com/cann/asc-comm/issues/59