Forked executor blocks until caller-supplied stdin reaches EOF
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/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, especially pump() and execute() around lines 83-98 and 118-160. Reproduce the behavior with a caller-supplied System.in and a child process that exits without stdin EOF. Done means execute() returns after the process exits, output pumps complete, and a finished process is not reported as timed out.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Affected version
1.0.0
Bug description
ForkedMavenExecutor cannot be given an interactive stdin. ProcessBuilderExecutorSupport.pump() starts three pump threads and returns a CountDownLatch(3); execute() then does latch.await() (or await(timeout)) before reading the exit code (ProcessBuilderExecutorSupport.java:83-98,118-160). The stdin pump runs IOTools.transferTo(stdIn, process.getOutputStream()), which blocks in read() on the caller's stream until EOF. With stdIn(System.in):
- without a timeout,
execute()never returns after the child exits, because the console never reaches EOF; - with a timeout,
awaittimes out and the child isdestroyForcibly()-ed, so a build that was already finished is reported asProcess timeout.
This is exactly the request maven-invoker's setInputStream(System.in) serves in maven-release's InvokerMavenExecutor (interactive prompts from the forked build, such as a GPG passphrase) and in maven-gpg-plugin's tests, so those two consumers cannot migrate to maven-executor until the pump either stops when the process exits or the executor waits on the process first and then only on the stdout/stderr pumps.
Proposal: waitFor() the process, then await the two output pumps, and interrupt or abandon the stdin pump; do not count it in the latch. Related: #45 (streams closed by the pumps) and the runtime section of #49.
- 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 ·
-
enhancement priority:major
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apache/maven-executor#49 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
apache/maven-executor#48 ·
-
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 ·