Container lookup failures during result polling are masked by UnboundLocalError
維護者通常 1 天內回覆
評估
研究方向
從 lean/components/docker/docker_manager.py 中的 read_from_file 開始:閱讀 try 區塊,該區塊會呼叫 get_container_by_name 和 Popen,然後閱讀通用 except,它會印出 p.stderr。用一個測試重現:該測試對 get_container_by_name 打補丁使其拋出 RuntimeError('Docker unavailable'),並呼叫 read_from_file('container', Path('result.json'), interval=0.01, timeout=0.1);當這能顯示出原始錯誤,且現有的成功讀取和重試測試仍然通過時,即完成。
由索引模型根據 Issue 內容生成。
描述
Problem
DockerManager.read_from_file dereferences p.stderr in its generic exception handler even when container lookup or Popen failed before p was assigned. A Docker connection failure is consequently replaced by UnboundLocalError.
Reproduction
On current master, mock get_container_by_name to raise RuntimeError('Docker unavailable'), then call read_from_file('container', Path('result.json'), interval=0.01, timeout=0.1).
Observed: UnboundLocalError: cannot access local variable 'p' where it is not associated with a value, rather than a diagnostic of the Docker failure. The same happens if the first process cannot be started.
The relevant exception handler is in lean/components/docker/docker_manager.py, inside read_from_file.
Required result
A failure before process creation must preserve the original diagnostic and must not fail while formatting it. Existing successful reads and retry behavior must remain intact.
- 主要語言
- 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 天內回覆
-
priority:P2
難度 2/5 1-3 小時 新手友好度 72/100
QuantConnect/lean-cli#785 ·
維護者通常 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 天內回覆
-
priority:P2
難度 2/5 1-3 小時 新手友好度 70/100
QuantConnect/lean-cli#778 ·
維護者通常 1 天內回覆
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
pimutils/vdirsyncer#1242 ·
-
backlog
難度 2/5 1-3 小時 新手友好度 78/100
sagemathinc/sagebrush#2768 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
vllm-project/vllm-ascend#23791 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
briandconnelly/context-audit#33 ·
維護者通常 1 天內回覆