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/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 于 206 天前认领,目前没有进行中的 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 documentation
难度 2/5 1-3 小时 新手友好度 78/100
awslabs/visual-asset-management-system#514 ·
维护者通常 1 天内回复
-
backend bug spec:REQ-053
难度 2/5 1-3 小时 新手友好度 66/100
nolte/kamerplanter#2547 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
EleutherAI/lm-evaluation-harness#4425 ·
维护者通常 1 天内回复
-
Gemini: respect PLANNING_DISABLED=1 in lifecycle context hooks可能已有人在做 @AmariAugustin 今天认领。 未关闭bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 87/100
OthmanAdi/planning-with-files#329 · 1 条评论 ·
维护者通常 1 天内回复
-
wr.dynamodb.read_items returns [{}] for a single partition value that does not exist可能已有人在做 @auraseb 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
aws/aws-sdk-pandas#3520 ·
维护者通常 2 天内回复