Blocking Docker stdout reads bypass the live result polling timeout
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 lean/components/docker/docker_manager.py 中的 read_from_file 方法開始,閱讀其周圍的 timeout/interval 迴圈;無界呼叫是 Popen 控制代碼上的 stdout.read()。尋找現有的 docker manager 測試,看看該方法是如何被執行的,然後依照 issue 所述用 FIFO writer 重現。完成的定義是:一個保持 stdout 開啟的 Docker exec 會在接近 timeout 時帶著診斷資訊返回,任何已啟動的 subprocess 都會被清理,而立即成功的讀取仍然成功。
由索引模型根據 Issue 內容生成。
描述
Problem
DockerManager.read_from_file checks its timeout only between attempts. Popen(...).stdout.read() has no deadline, so a Docker exec that never closes stdout can block the method indefinitely despite its timeout argument.
Reproduction and evidence
A minimal real-Docker reproduction uses a running Bash container:
- Create
/tmp/delayed-fifowithmkfifo. - Start another exec that waits 0.6 seconds, then writes
{"Success":true}into the FIFO. - Call
read_from_file(container_name, Path('/tmp/delayed-fifo'), interval=0.01, timeout=0.05).
On current master, the call returned success after 0.698 seconds, well beyond its 0.05-second timeout. If the writer never writes or closes the FIFO, the read has no bound. The FIFO demonstrates the blocking stream; a stalled Docker exec can leave stdout open in the same way.
Relevant code: lean/components/docker/docker_manager.py, the stdout.read() in read_from_file.
Required result
Waiting for a Docker exec must not bypass the result wait's deadline. On expiry, clean up any subprocess the method started and return a useful timeout diagnostic. Preserve immediate successful reads. Suggestion: use a subprocess communication API with the remaining timeout rather than an unbounded stream read.
- 主要語言
- Python
- 星號
- 335
- 分支
- 172
- 平均合併
- 6 小時 54 分鐘
- 30 天內合併 PR
- 37
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
QuantConnect/lean-cli 的其他 Issue
-
priority:P2
難度 2/5 1-3 小時 新手友好度 75/100
QuantConnect/lean-cli#792 ·
維護者通常 1 天內回覆
-
priority:P2
難度 2/5 1-3 小時 新手友好度 74/100
QuantConnect/lean-cli#786 ·
維護者通常 1 天內回覆
-
A partially written live command result aborts polling with JSONDecodeError可能已有人在做 @pcbeingused333 於 3 天前認領。 未關閉priority:P2
難度 2/5 1-3 小時 新手友好度 72/100
QuantConnect/lean-cli#784 ·
維護者通常 1 天內回覆
-
Container lookup failures during result polling are masked by UnboundLocalError可能已有人在做 @pcbeingused333 於 5 天前認領。 未關閉priority:P2
難度 2/5 1-3 小時 新手友好度 80/100
QuantConnect/lean-cli#783 ·
維護者通常 1 天內回覆
-
priority:P2
難度 2/5 1-3 小時 新手友好度 70/100
QuantConnect/lean-cli#778 ·
維護者通常 1 天內回覆
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
pimutils/vdirsyncer#1242 ·
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
open-webui/open-webui#35360 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)未關閉
難度 1/5 1 小時以內 新手友好度 68/100
-
bug
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆