Live result polling reports an exited container as still running

未关闭 适合新手
#786 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, python
领域
cli

调研方向

从 lean/components/docker/docker_manager.py 中的 read_from_file 和 get_containers_by_name 开始;将 containers.list(all=True) 得到的容器状态与当前仅检查是否存在的逻辑进行比较。用一个已停止、非 --rm 的 Bash 容器和 read_from_file(..., interval=0.01, timeout=0.25) 复现,然后确认 lean/commands/live/live.py:get_result 仍然收到正确的 flag。完成意味着已注册的已停止容器能及时返回 container-running=false,而运行中的容器仍然轮询,缺失的容器行为与之前相同。

由索引模型根据 Issue 内容生成。

描述

priority:P2

Problem

DockerManager.read_from_file sets container-running=false only when the container no longer exists. get_container_by_name searches stopped containers too, so an exited container is treated as running, and failed execs are retried until the result timeout.

Reproduction and evidence

  1. Start a disposable Bash container without --rm, then stop it so it remains registered in Docker.
  2. Call read_from_file(container_name, Path('/tmp/absent.json'), interval=0.01, timeout=0.25).

On current master, the call returns success=false, a result-file timeout error, and container-running=true, while Docker reports the container's status as exited.

Relevant code: lean/components/docker/docker_manager.py, the container check in read_from_file and containers.list(all=True) in get_containers_by_name. lean/commands/live/live.py:get_result relies on the returned flag to report whether the container is running.

Required result

A registered but stopped container must be reported as not running promptly rather than being described as a running container whose result file timed out. Preserve polling for running containers and the existing handling of missing containers.

主要语言
Python
星标
335
派生
172
平均合并
6 小时 54 分钟
30 天内合并 PR
37

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

QuantConnect/lean-cli 的其他 Issue

查看 QuantConnect/lean-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。