Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Forked executor blocks until caller-supplied stdin reaches EOF

Aperta
#50 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

bug
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, await times out and the child is destroyForcibly()-ed, so a build that was already finished is reported as Process 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/maven-executor

Tutte le issue di apache/maven-executor

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.