Pull Request已成功合入, 合并人@CANN-robot
(感谢 KaranocaVe 的贡献)变更摘要
本 PR 修复 SubProcessController::CloseSubProcList 分批关闭子进程时的零计数批次问题。原实现在按每批 50 条(CLOSE_PID_PER_LOOP)发送后,无论余数是否为 0 都会再次调用 ExecuteClosePidList 发送余数批次,而该函数拒绝零计数请求,导致恰好 50 条(余数为 0)的合法请求在第一批成功后仍返回 TSD_INTERNAL_ERROR。修复将余数批次的发送包裹在 reserveCnt > 0U 条件内,仅在有剩余条目时才发送余数批次;并新增回归测试验证恰好 50 条时只发送一批且返回成功。49 条、51 条及通信失败路径的批量语义保持不变。
主要改动
- 跳过零计数余数批次: 在
sub_process_controller.cpp中,将余数批次发送改为仅在reserveCnt > 0U时执行ExecuteClosePidList,避免余数为 0 时调用该函数产生TSD_INTERNAL_ERROR,同时将成功日志TSD_RUN_INFO移入条件分支内。 - 新增 50 条边界回归测试: 在
sub_process_controller_utest.cpp中新增CloseSubProcList_FiftyEntries_SendsSingleBatch用例,构造恰好 50 个ProcStatusParam条目,断言CloseSubProcList返回TSD_OK、仅发送 1 条TSD_CLOSE_SUB_PROC_LIST消息且消息内包含 50 个子进程 PID,覆盖修复后的边界行为。


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
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| src/tsd | ✅ ZhaiPeiChao, LiWei79 (2/2) | ✅ ZhaiPeiChao (1/1) |
| tests/ut/tsd | ✅ ZhaiPeiChao, LiWei79 (2/2) | ✅ ZhaiPeiChao (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


compile


流水线任务触发成功
任务链接 [e3640e56275c49d2be55dfaa7da865f6][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ 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_msprof_part1 | ✅ SUCCESS | ||
| UT_Test_msprof_part2 | ✅ SUCCESS | ||
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| UT_Test_camodel_check | ✅ SUCCESS | ||
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_report | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_report | ✅ SUCCESS | >>>>> |
[2026-08-25 20:16:48] CI执行结束


流水线任务触发成功
任务链接 [4b9882054e894315b65a86f299399c32][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Check_Pr | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-08-25 20:02:25] CI执行结束


当前 head fd11d431e32712eea0b9fb5b03d2a4f2da6dc268 的 CI 已通过,PR 已具备代码检视条件。烦请 @ykl999 @wangtao43 @tingwood @yanmingxiang @Reyn52166 协助复核;如确认无误,请按仓库规则继续执行 /lgtm 和 /approve。


当前 PR 仍未满足代码检视与合入审批要求。烦请 @ykl999 @wangtao43 @tingwood @yanmingxiang @Reyn52166 @LiWei79 @ZhaiPeiChao 协助复核当前变更;如确认无误,请按仓库规则执行 /lgtm 和 /approve。


/approve


The following label is not ready.
ci-pipeline-passed: The ci-pipeline-passed label is expired as added over 72 hours. Please use /compile to recompile.


@KaranocaVe 你的代码我已经review,但是CI流水线结果已经过期,无法合入,请重新compile。


/compile


流水线任务触发成功
任务链接 [15ec781a06ad431393d546a753b9c3eb][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ 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_msprof_part1 | ✅ SUCCESS | ||
| UT_Test_msprof_part2 | ✅ SUCCESS | ||
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| UT_Test_camodel_check | ✅ SUCCESS | ||
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_report | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_report | ✅ SUCCESS | >>>>> |
[2026-08-31 10:13:30] CI执行结束




修复摘要
CloseSubProcList按 50 条分批发送时,即使余数为 0 也会再次调用ExecuteClosePidList。该函数拒绝零计数,因此恰好 50 条的合法请求在第一批成功后仍返回
TSD_INTERNAL_ERROR。修复只在reserveCnt > 0时发送余数批次。变更范围
src/tsd/tsdclient/src/sub_process_controller.cpp:跳过零计数余数批次。tests/ut/tsd/tsdclient/sub_process_controller_utest.cpp:增加恰好 50 条只发送一批且返回成功的回归测试。
49 条、51 条以及通信失败路径保持原有批量语义;修复不改变非零余数批次处理。
测试结果
tsd_client_utest,退出码为0。tsd_client_utest --gtest_color=no --gtest_filter='SubProcessControllerTest.CloseSubProcList_*:SubProcessControllerTest.OpenAndCloseHccp_*',6/6 用例通过,覆盖 49、50、51 条边界及通信失败对照。
TSD client,未执行匹配版本的 NPU 运行。
关联的 Issue
Patch 来源
681ef7610df13c8128982901142a2c869ddbb53efix.patch331d8d2e22dafa7b3a7328a3a8bccc43055fe78fe27a0cbc614efb9ba7c41144