Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Forked executor closes caller-supplied stdout and stderr streams

オープン
#45 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java
領域
build-system

調査の方向性

Start in maven-executor/src/main/java/org/apache/maven/executor/support/ProcessBuilderExecutorSupport.java at lines 124 and 137, then compare stream handling in EmbeddedMavenExecutor.java at lines 293-294. Trace ExecutorRequest.Builder.stdOut() and stdErr() to confirm the ownership contract. Done means caller-supplied streams are flushed without being closed, shared stdout/stderr streams work, and the ownership behavior is documented.

索引モデルが issue の本文から書いたものです。

説明

bug
Affected version

1.0.0

Bug description

ForkedMavenExecutor closes the OutputStream instances a caller passes through ExecutorRequest.Builder.stdOut() and stdErr(). Each pump thread wraps the stream in try-with-resources (ProcessBuilderExecutorSupport.java:124,137), so:

  • A caller that hands the same stream to both stdOut() and stdErr() to get one interleaved log, as maven-verifier produced, gets two threads racing to close it, and the second transferTo can fail with a closed stream.
  • A caller that passes System.out or a stream it intends to keep using loses it after the first execution.
  • EmbeddedMavenExecutor wraps the same streams in PrintStream instances (EmbeddedMavenExecutor.java:293-294) and does not close them, so the two executors treat ownership differently.

Found while porting maven-integration-testing and maven-surefire's IT fixtures from maven-verifier (apache/maven-verifier#186); both now wrap the log file in a stream with an idempotent close().

Proposal: the executor should not close streams it did not open. Flush them after the pump finishes and leave closing to the caller, and document that stdOut() and stdErr() may be the same stream. If closing has to stay for compatibility, document it in ExecutorRequest.Builder Javadoc.

主要言語
Java
スター
5
フォーク
2
平均マージ
4時間 22分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/maven-executor のほかの issue

apache/maven-executor の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。