Local live deployment keeps running after SIGTERM and can be deployed twice
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Python
- Étoiles
- 327
- Forks
- 170
- Merge moyen
- 8 j 14 h
- PR mergées (30 j)
- 7
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de QuantConnect/lean-cli
-
Environment values containing '=' are truncated in --extra-docker-configPeut-être pris @Amadeus-22 l’a pris il y a 2 jours. Ouverte
Difficulté 1/5 1-3 heures Accessibilité débutants 1/100
QuantConnect/lean-cli#679 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
QuantConnect/lean-cli#661 · 1 commentaire ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
QuantConnect/lean-cli#619 ·
-
Implements AutocompletePeut-être à nouveau libre @shreejaykurhade l’a pris il y a 208 jours, et aucune pull request n’est ouverte. Ouvertefeature
QuantConnect/lean-cli#602 · 6 commentaires · 3 réactions · 1 personne assignée ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
QuantConnect/lean-cli#579 ·
Toutes les issues de QuantConnect/lean-cli
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
pgvector/pgvector-python#169 ·
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitPeut-être pris @MohabMohie l’a pris aujourd’hui. Ouverteagentic
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
huggingface/smolagents#3045 ·
Les mainteneurs répondent en général sous 1 jour