已合并
[UBSE] #feat UBSE 链路亚健康自动化 #1469
[UBSE] #feat UBSE 链路亚健康自动化 #1469
已合并
quanletian创建于 18 天前
quanletian
quanletian
18 天前

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

[UBSE] #feat UBSE 链路亚健康自动化

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

likedislike
Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 quanletian 的贡献)
quanletianquanletian
18 天前 创建了 pull request,commit e3d3222d
atomgit-bot
atomgit-bot
18 天前 评论:

变更摘要

该 PR 聚焦于 UBSE 链路亚健康检测的自动化:在 src/controllers/node/ubse_node_controller.cpp 中新增了调用外部工具 hikptool 生成最新亚健康检测结果的流程,并接入到 UbseNodeController::RefreshSubHealthCache() 的缓存刷新逻辑中,使每次刷新前先自动执行检测、生成新的 detection.json,检测失败时保留旧缓存并返回错误码。

主要改动

  • 新增子健康检测执行流程 RunSubHealthDetection(): 校验 hikptool 可执行文件与 libhikptdev.so.1 动态库可读后,在父进程中构造带 LD_LIBRARY_PATH 的子进程环境,通过 fork/execve 执行 sub_health 命令并 waitpid 等待,最后校验退出码与 detection.json 是否生成。
  • 新增工作目录准备 PrepareSubHealthWorkDir(): 创建 /var/log/ubse 目录(已存在则忽略 EEXIST)并校验其可写性,作为检测工具的运行目录。
  • 改造缓存刷新流程 RefreshSubHealthCache(): 在加载检测结果前先调用 RunSubHealthDetection() 生成最新检测结果,若执行失败则记录告警并保持旧缓存、直接返回错误码。
  • 新增常量与头文件: 引入 SUB_HEALTH_HIKPTOOL_BINSUB_HEALTH_HIKPTOOL_LIB_DIRSUB_HEALTH_WORK_DIR 等配置常量,并补充 <cerrno><sys/stat.h><sys/wait.h><unistd.h> 头文件及 extern char** environ; 声明。
likedislike
不准确?
openeuler-ci-botopeneuler-ci-bot成员
18 天前 将hlinbo,shw030915,Gao_Victor,qmyyxtl,caowaterman设为审查人
atomgit-bot
atomgit-bot
18 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
openeuler-ci-botopeneuler-ci-bot成员
18 天前 添加了label:sig/sig-UB-ServiceCore
此处折叠了110条消息 查看更多
openeuler-ci-bot
openeuler-ci-bot成员
13 天前 评论:

Review Code Feedback

  • The label lgtm-xuchenfengcleancode, approved was added to this pull request. It means that xuchenfengcleancode reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
hlinbo成员
13 天前 评论:

/lgtm
/approve

likedislike
openeuler-ci-botopeneuler-ci-bot成员
13 天前 添加了label:lgtm-hlinbo
openeuler-ci-bot
openeuler-ci-bot成员
13 天前 评论:

Review Code Feedback

  • The label lgtm-hlinbo was added to this pull request. It means that hlinbo reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-botopeneuler-ci-bot成员
13 天前 合入了pull request,合并节点 SHA:277499fffdf435bd2bb2c6a775e2f1176c1aed18