Local live deployment keeps running after SIGTERM and can be deployed twice
まだ誰も着手していません。
評価
調査の方向性
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時間
- マージ済み PR(30日)
- 7
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 25/100
QuantConnect/lean-cli#619 ·
-
Implements Autocomplete再び着手できるかも @shreejaykurhade が 207 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンfeature
QuantConnect/lean-cli#602 · コメント 6 件 · リアクション 3 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
QuantConnect/lean-cli#579 ·
QuantConnect/lean-cli の issue をすべて見る
似ている issue
-
[Bug] Unit tests reach real Bedrock call paths without patching the model対応中かも @proton0210 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
aws-samples/sample-aws-genai-db-modernizer#1318 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
pyarrow-25.0.1-cp310-cp310-manylinux_2_28_x86_64.whl: 1 vulnerabilities (highest severity is: 5.3)オープンMend: dependency security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
capitalone/locopy#394 ·
-
[Bug] Unhandled ValueError terminates watchdog thread when GISRC value contains multiple colonsオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
sdk-typescript: unquoted COPY globs in shell form are silently dropped from the image build contextオープンbug javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ietf-tools/datatracker#11922 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信