Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Forked executor leaves the process tree behind on timeout

Đang mở
#48 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả 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 the executionTimeout handling, then inspect the Java 9 layer under src/main/java9. Reproduce the issue with a Surefire test that loops and appends to a heartbeat file; done means the heartbeat stops after ExecutorException and the forked processes are terminated.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

ProcessBuilderExecutorSupport handles executionTimeout with process.destroyForcibly() on the process it started (ProcessBuilderExecutorSupport.java, the else branch after await(timeoutMillis, ...)). That reaches one process:

  • On Linux and macOS bin/mvn ends in exec, so the started process is the Maven JVM and it dies; the JVMs Maven forked (Surefire, Failsafe, exec:exec) are not touched and keep running.
  • On Windows the started process is cmd.exe running bin/mvn.cmd (ForkedMavenExecutor resolves command() + ".cmd"); the Maven JVM is its child and survives with everything under it.

maven-invoker had the same defect as apache/maven-invoker#135 (MSHARED-867), reported on Windows but reproducible everywhere with a Surefire fork that never ends; apache/maven-invoker#185 fixes it by destroying ProcessHandle.descendants() before the parent. maven-executor already has a Java 9 layer (src/main/java9), so the same can go there without reflection: on timeout, process.toHandle().descendants().forEach(ProcessHandle::destroyForcibly) and then process.destroyForcibly(); the descendants first, since on Linux they are reparented once the parent is gone.

A test that shows it: a project whose Surefire test loops forever and appends to a heartbeat file, executed with a timeout; after the ExecutorException the file must stop growing.

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/maven-executor

Tất cả issue của apache/maven-executor

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.