Local live deployment keeps running after SIGTERM and can be deployed twice
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 327
- Forks
- 170
- Ø Merge
- 8 T. 14 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus QuantConnect/lean-cli
-
Environment values containing '=' are truncated in --extra-docker-configEvtl. vergeben @Amadeus-22 hat das heute übernommen. Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 1/100
QuantConnect/lean-cli#679 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
QuantConnect/lean-cli#661 · 1 Kommentar ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
QuantConnect/lean-cli#619 ·
-
Implements AutocompleteEvtl. wieder frei @shreejaykurhade hat das vor 207 Tagen übernommen, und es ist kein Pull Request offen. Offenfeature
QuantConnect/lean-cli#602 · 6 Kommentare · 3 Reaktionen · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
QuantConnect/lean-cli#579 ·
Alle Issues in QuantConnect/lean-cli
Ähnliche Issues
-
Use mhctools predictor_required=False for saved-result rescoringEvtl. vergeben @iskandr hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
521xueweihan/HelloGitHub#4051 · 1 Kommentar ·
-
bug documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
awslabs/visual-asset-management-system#514 ·
Maintainer antworten meist innerhalb von 1 Tag
-
backend bug spec:REQ-053
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
nolte/kamerplanter#2547 ·
Maintainer antworten meist innerhalb von 1 Tag