Forked executor blocks until caller-supplied stdin reaches EOF
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
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.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-executor
-
EmbeddedMavenExecutor restores a constructor-time System snapshot after every runMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/maven-executor#46 ·
Maintainers usually reply within 3 days
-
Forked executor discards the output it grabbed when an execution times outPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apache/maven-executor#58 ·
Maintainers usually reply within 3 days
-
enhancement priority:major
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/maven-executor#49 · 1 comment ·
Maintainers usually reply within 3 days
-
Forked executor leaves the process tree behind on timeoutPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 78/100
apache/maven-executor#48 ·
Maintainers usually reply within 3 days
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
apache/maven-executor#45 ·
Maintainers usually reply within 3 days
All issues in apache/maven-executor
Similar issues
-
Clarify Javadoc for Logger methods taking Object... arguments with regards to Throwable detectionOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
[Bug] The shared instance selector's placeholder and no-match text ignore the display languagePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
apache/rocketmq-dashboard#5561 ·
Maintainers usually reply within 3 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HMCL-dev/HMCL#6934 · 1 comment ·
Maintainers usually reply within 1 day
-
test(setup): GitHub configuration tests fail when the temp path is long enough for YAML foldingOpenbug good first issue help wanted priority medium size S
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
martin-francois/symphony-trello#776 · 1 comment ·
Maintainers usually reply within 1 day