Local live deployment keeps running after SIGTERM and can be deployed twice
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 327
- Fork
- 170
- Merge trung bình
- 8 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QuantConnect/lean-cli
-
Environment values containing '=' are truncated in --extra-docker-configCó thể đã có người làm @Amadeus-22 đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 1/100
QuantConnect/lean-cli#679 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
QuantConnect/lean-cli#661 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
QuantConnect/lean-cli#619 ·
-
Implements AutocompleteCó thể làm lại được @shreejaykurhade đã nhận 207 ngày trước và không có pull request nào đang mở. Đang mởfeature
QuantConnect/lean-cli#602 · 6 bình luận · 3 reaction · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
QuantConnect/lean-cli#579 ·
Tất cả issue của QuantConnect/lean-cli
Issue tương tự
-
idxmax/idxmin raise ValueError when a single partition is all-NACó thể đã có người làm @Jason10191019999 đã nhận hôm nay. Đang mởneeds triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Old versions of datamodelsĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
[BUG]: Windows GUI package of v1.17.0-rc3 has no GTK DLLsCó thể đã có người làm @andrut-ds đã nhận hôm nay. Đang mởbug CI/CD Pactus-GUI Windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pactus-project/pactus#2428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DiskDataset.reshard() can hang with a zero or negative shard sizeCó thể đã có người làm @Programmer-Develops đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 19 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
GNS3/gns3-server#3017 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày