Forked executor leaves the process tree behind on timeout
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- build-system
Direzione di ricerca
Start in maven-executor/src/main/java/org/apache/maven/executor/support/ProcessBuilderExecutorSupport.java at the executionTimeout handling, then inspect the Java 9 layer under src/main/java9. Reproduce the issue with a Surefire test that loops and appends to a heartbeat file; done means the heartbeat stops after ExecutorException and the forked processes are terminated.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
ProcessBuilderExecutorSupport handles executionTimeout with process.destroyForcibly() on the process it started (ProcessBuilderExecutorSupport.java, the else branch after await(timeoutMillis, ...)). That reaches one process:
- On Linux and macOS
bin/mvnends inexec, so the started process is the Maven JVM and it dies; the JVMs Maven forked (Surefire, Failsafe, exec:exec) are not touched and keep running. - On Windows the started process is
cmd.exerunningbin/mvn.cmd(ForkedMavenExecutorresolvescommand() + ".cmd"); the Maven JVM is its child and survives with everything under it.
maven-invoker had the same defect as apache/maven-invoker#135 (MSHARED-867), reported on Windows but reproducible everywhere with a Surefire fork that never ends; apache/maven-invoker#185 fixes it by destroying ProcessHandle.descendants() before the parent. maven-executor already has a Java 9 layer (src/main/java9), so the same can go there without reflection: on timeout, process.toHandle().descendants().forEach(ProcessHandle::destroyForcibly) and then process.destroyForcibly(); the descendants first, since on Linux they are reparented once the parent is gone.
A test that shows it: a project whose Surefire test loops forever and appends to a heartbeat file, executed with a timeout; after the ExecutorException the file must stop growing.
- Lingua principale
- Java
- Stelle
- 5
- Fork
- 2
- Merge medio
- 4h 22m
- PR unite (30g)
- 2
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. 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 apache/maven-executor
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/maven-executor#46 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
apache/maven-executor#50 ·
-
enhancement priority:major
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apache/maven-executor#49 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
apache/maven-executor#47 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
apache/maven-executor#45 ·
Tutte le issue di apache/maven-executor
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
oracle/javavscode#652 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenAPITools/openapi-generator#25014 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
AloisSeckar/demos-java#380 ·