Child keeps running after its client is killed by SIGTERM, SIGHUP or SIGKILL
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend, operating-systems
Direzione di ricerca
Start by reading Spring::Application#wait and the existing SIGINT forwarding path. Reproduce the issue with the Linux shell commands in the report, then trace how the client socket and spawned command process are managed. Done means child processes are cleaned up after the described client signals or socket EOF, and spring stop no longer waits on orphaned children.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When a Spring 4.7.0 client process ends by "deadly" signals such as SIGTERM, SIGKILL, SIGHUP, the command process spawned by the Spring application will keep running until it finishes on its own, or forever if it waits on something. That can cause problems when it's consuming resources or holding locks.
Minimal repro (tested on Linux):
bin/rails runner 'sleep 60' & sleep 10; kill -TERM $! # or -HUP, -KILL
sleep 2; ps -eo pid,args | grep '[r]ails_runner' # still running
SIGINT works as expected but it would be great if other signals were covered as well. It would be useful, for example, when...
timeout(1)times out (SIGTERM)- an agent subprocess is ended (often SIGTERM then SIGKILL)
- a terminal window or tab is closed, or an SSH or docker session is lost (SIGHUP)
- just using plain
killwith default args (SIGTERM)
I'd be happy to prepare a PR for it if that's welcome. My proposed fix is to treat unexpected EOF on the client socket as the client's death in Spring::Application#wait and send TERM to the command's process group - that should cover all cases.
EDIT: Actually it would be more accurate to forward termination signals like TERM, HUP and ALRM the same way INT is forwarded, and use EOF as a catch-all for a crash (SEGV and the like, which would be a bit silly to forward) and most importantly KILL (which can't be forwarded).
EDIT: I've also noticed that with orphaned children, spring stop reports success but leaves the server and the application process (that spawned the orphan) running until all orphans have exited. That would be fixed as a side-effect ✨
- Lingua principale
- Ruby
- Stelle
- 2.8k
- Fork
- 343
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 rails/spring
-
Process hangs on springApertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Bug: undefined method `hide_cursor' for Reline::GeneralIO:Class (NoMethodError)Forse già presa @rafaelfranca l’ha presa 143 giorni fa. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
Tutte le issue di rails/spring
Issue simili
-
開発用DockerイメージにPlaywrightのシステム依存を追加するForse già presa @momocus l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
sakazuki-org/sakazuki#1453 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
jenkins-infra/jenkins.io#9615 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtimeForse già presa @Goldziher l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Metric tooltips that contradict how the metric is calculatedForse già presa @aniadeadu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WikiEducationFoundation/WikiEduDashboard#7303 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
WhatsApp Cloud template sync saves a partial template list when one page of the Graph API response failsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni