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 摘要。