已合并
【PR】: xpu resource leak #4019
sunnana_004434229创建于 8月4日
【PR】: xpu resource leak #4019
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 sunnana_004434229 的贡献)8月4日 添加了label:enhancement
8月4日 创建了 pull request,commit a03cde05
atomgit-bot
8月4日 评论:
8月4日 评论:
变更摘要
本次 PR 主要修复 XPU 模块中存在的一处资源泄露问题,核心原因是任务反初始化流程中错误引用了 g_taskUnInitFunc 而非正确的 g_taskXpuUnInitFunc,导致 XPU 资源的释放逻辑被跳过。同时附带调整了两处日志:为资源释放增加可追踪的 info 日志,以及将队列 peek 失败场景的日志级别从 ERROR 降为 INFO,避免正常的空队列情况触发误报。
主要改动
- 修复反初始化函数数组引用错误: 在
task_manager_xpu.cc的XpuTaskUnInitProc中,将g_taskUnInitFunc更正为g_taskXpuUnInitFunc,确保任务反初始化时调用正确的 XPU 资源释放函数,解决资源泄露问题。 - 新增资源释放追踪日志: 在
xpu_kernel_task.cc的TprtDavinciTaskUnInit中,ArgRelease调用后新增RT_LOG日志,输出stream_id和task_sn,便于追踪资源释放过程。 - 降低 peek 失败日志级别: 在
tprt_device.cc的ProcessWaitingTask中,将队列 peek 任务失败时的日志从TPRT_LOG_ERROR降为TPRT_LOG_INFO,消息也由 "Failed to peek task" 改为 "not peek task",避免空队列场景产生误导性错误日志。


atomgit-bot
8月4日 评论:
8月4日 评论:
8月4日 添加了label:cann-cla/yes
CANN-robot
8月4日 评论:
8月4日 评论:
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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| 9.1.0 | ✅ 侯延保, Andy-lb (2/2) | ✅ Andy-lb (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
sunnana_004434229, thanks for your pull request. All authors of the commits have signed the CLA. 👍


8月4日 将jiangtao_rts,hanxiaolong,gcw_kUomxQ2l,Andy-lb设为审查人
此处折叠了10条事件消息 查看更多
8月4日 添加了label:cann-cla/yes
sunnana_004434229
8月4日 评论:
8月4日 评论:
/compile


Ssunnana_004434229
8月4日 update merge request[project id: 8810053, iid: 4019, commit_id: c3f9ad9dc86c6f150d1a07884cf022248e49ae80] virtual merging success
8月4日 update merge request[project id: 8810053, iid: 4019, commit_id: c3f9ad9dc86c6f150d1a07884cf022248e49ae80] virtual merging success
8月4日 添加了label:ci-pipeline-running
CANN-robot
8月4日 评论:
8月4日 评论:
流水线任务触发成功
任务链接 [35676ec5fab84c14a681e6a14170cf22][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_acl | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_v201 | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_c | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_david | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_910b | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_common | ✅ SUCCESS | >>>>> | |
| UT_Test_platform | ✅ SUCCESS | >>>>> | |
| UT_Test_qs | ✅ SUCCESS | >>>>> | |
| UT_Test_aicpusd | ✅ SUCCESS | >>>>> | |
| UT_Test_tsd | ✅ SUCCESS | >>>>> | |
| UT_Test_error_manager | ✅ SUCCESS | >>>>> | |
| UT_Test_slog | ✅ SUCCESS | >>>>> | |
| UT_Test_atrace | ✅ SUCCESS | >>>>> | |
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_report | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_report | ✅ SUCCESS |
[2026-08-04 10:56:26] CI执行结束


CANN-robot
8月4日 评论:
8月4日 评论:
流水线任务触发成功
任务链接 [bb885ddef3a543f38e4bbbe4f7bc656c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Check_Pr | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-08-04 10:52:20] CI执行结束


8月4日 删除了label:ci-pipeline-running
8月4日 添加了label:ci-pipeline-passed
29 天前 添加了label:lgtmapproved
29 天前 合入了pull request
Pull Request
描述
xpu resource leak。
变更类型
请选择本次引入的变更类型:
关联的Issue
如何测试
描述测试此变更的步骤和前提条件:
1.
2.
核对清单
其他信息
在此添加任何其他关于本次 PR 的说明。