Forked executor closes caller-supplied stdout and stderr streams
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- build-system
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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()andstdErr()to get one interleaved log, asmaven-verifierproduced, gets two threads racing to close it, and the secondtransferTocan fail with a closed stream. - A caller that passes
System.outor a stream it intends to keep using loses it after the first execution. EmbeddedMavenExecutorwraps the same streams inPrintStreaminstances (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.
- Ngôn ngữ chính
- Java
- Star
- 5
- Fork
- 2
- Merge trung bình
- 4 giờ 22 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/maven-executor
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
apache/maven-executor#46 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
apache/maven-executor#50 ·
-
enhancement priority:major
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/maven-executor#49 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
apache/maven-executor#48 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/maven-executor#47 ·
Tất cả issue của apache/maven-executor
Issue tương tự
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/flink-agents#1156 ·
-
[source-shopify] FAILED bulk operation without partialDataUrl is silently treated as successful Đang mởarea/connectors autoteam community connectors/source/shopify needs-triage team/use type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100