Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Forked executor blocks until caller-supplied stdin reaches EOF

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
build-system

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Java
Stars
5
Forks
4
Avg merge
2d 5h
Merged PRs (30d)
2

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-executor

All issues in apache/maven-executor

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.