Local live deployment keeps running after SIGTERM and can be deployed twice
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 327
- Fork
- 170
- Merge medio
- 8g 14h
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di QuantConnect/lean-cli
-
Environment values containing '=' are truncated in --extra-docker-configForse già presa @Amadeus-22 l’ha presa 1 giorno fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 1/100
QuantConnect/lean-cli#679 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
QuantConnect/lean-cli#661 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
QuantConnect/lean-cli#619 ·
-
Implements AutocompleteForse di nuovo libera @shreejaykurhade l’ha presa 207 giorni fa e non c’è nessuna pull request aperta. Apertafeature
QuantConnect/lean-cli#602 · 6 commenti · 3 reazioni · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
QuantConnect/lean-cli#579 ·
Tutte le issue di QuantConnect/lean-cli
Issue simili
-
changelog investigate
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ramnes/notion-sdk-py#423 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 89/100
duckdb/duckdb-web#7514 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jbacalso24/mimry#525 ·
I maintainer di solito rispondono entro 1 giorno