Local live deployment keeps running after SIGTERM and can be deployed twice
還沒有人認領這個 Issue。
評估
研究方向
Start with lean/components/docker/docker_manager.py around DockerManager.run_image and its existing signal_handler; check how lean live deploy builds Docker run options and whether deployment lookup already exists. Reproduce termination with the commands in the issue, then verify that supported signals stop the container and repeated deployment of the same project is refused or warned about. The issue proposes separating the signal fix from labeling and duplicate checks, whose deploy-flow approach still needs confirmation.
由索引模型根據 Issue 內容生成。
描述
Expected Behavior
When the lean process running a local (non-detached) lean live deploy is terminated, the LEAN container stops too, as it does on Ctrl+C. Starting a second local live deployment of a project whose deployment is still running is refused, or at least warned about.
Actual Behavior
DockerManager.run_imageregisters a handler forSIGINTonly (lean/components/docker/docker_manager.py:242), and the container always runs detached. OnSIGTERMorSIGHUP(closed SSH session,systemctl stop,timeout, a cancelled CI job or k8s pod) the CLI exits with 143 and the container keeps trading. Reproduced with Docker 29 on Linux.lean live deploydoes not look for a running container of the same project. Containers get a randomlean_cli_<uuid>name, so a restart (for example a systemd unit withRestart=always, or simply running the command again after the above) starts a second algorithm on the same brokerage account.
Potential Solution
- Route
SIGTERMandSIGHUP(where available) through the existingsignal_handler, so they stop the container like Ctrl+C. - Label LEAN containers with the project path or id, the environment and the brokerage (
labelsinrun_options). - In
live deploy, look up running containers with the same project label and refuse with a clear message, offeringlean live stop <project>or a--forceflag.
Step 1 is small and I can open it as a PR first. Steps 2 and 3 change the deploy flow, so I'd like to confirm the approach before writing them.
Reproducing the Problem
lean live deploy MyProject --brokerage "Paper Trading" ... &
kill -TERM $!
docker ps --filter name=lean_cli_ # the container is still running
lean live deploy MyProject --brokerage "Paper Trading" ... # a second container starts
System Information
lean-cli master at b4d724c, Python 3.12, Linux, Docker 29.
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- 主要語言
- Python
- 星號
- 327
- 分支
- 170
- 平均合併
- 8 天 14 小時
- 30 天內合併 PR
- 7
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
QuantConnect/lean-cli 的其他 Issue
-
Environment values containing '=' are truncated in --extra-docker-config可能已有人在做 @Amadeus-22 於 1 天前認領。 未關閉
難度 1/5 1-3 小時 新手友好度 1/100
QuantConnect/lean-cli#679 ·
-
難度 4/5 3-5 天 新手友好度 55/100
QuantConnect/lean-cli#661 · 1 則留言 ·
-
難度 5/5 一週以上 新手友好度 25/100
QuantConnect/lean-cli#619 ·
-
Implements Autocomplete可能重新可做 @shreejaykurhade 於 207 天前認領,目前沒有進行中的 PR。 未關閉feature
QuantConnect/lean-cli#602 · 6 則留言 · 3 個 reaction · 已指派 1 人 ·
-
難度 4/5 3-5 天 新手友好度 35/100
QuantConnect/lean-cli#579 ·
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
anchore/grype-db#1149 · 1 則留言 ·
維護者通常 1 天內回覆
-
[Bug]: `hermes plugins update` clones an entire monorepo twice - `subdir` is resolved but dropped at both catalog-update call sites可能已有人在做 @HootRock 今天認領。 未關閉comp/cli P2 type/perf
難度 2/5 1-3 小時 新手友好度 72/100
NousResearch/hermes-agent#142417 · 2 則留言 ·
維護者通常 1 天內回覆
-
SMC SPEC
難度 2/5 1-3 小時 新手友好度 70/100
tenstorrent/tt-oca-harness#3287 ·
維護者通常 1 天內回覆
-
bug enhancement python
難度 2/5 1-3 小時 新手友好度 85/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#392 ·
維護者通常 1 天內回覆
-
security
難度 2/5 1-3 小時 新手友好度 72/100
fabriziosalmi/wildbox#801 ·
維護者通常 1 天內回覆