Skip to content

[Bug] packaging.py 多处 subprocess.run 无超时,打包/建环境可能挂起 #223

Description

缺陷描述

foundation/openjiuwen_runtime/foundation/packaging.py 中 4 处 subprocess.run 均未设置 timeout:

  • package_python_to_whl 调用 python -m build(第 44-49 行)
  • create_virtualenv 调用 python -m venv(第 84 行)
  • install_package 调用 pip install(第 121-125 行)
  • uninstall_package 调用 pip uninstall(第 143-147 行)

影响

  • 打包或建环境时子进程卡住会导致整个部署/打包流程无限期挂起
  • TimeoutExpired 也未按各函数的异常契约(RuntimeError / bool)处理

文件位置

foundation/openjiuwen_runtime/foundation/packaging.py

修复建议

为每个 subprocess.run 增加合理 timeout(build 600s、venv 300s、install 600s、uninstall 300s),并将 TimeoutExpired 分别包装为 RuntimeError 或返回 False。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions