Forked executor leaves the process tree behind on timeout
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ả
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/mvnends inexec, 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.exerunningbin/mvn.cmd(ForkedMavenExecutorresolvescommand() + ".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
- Đọ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ó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/maven-executor#47 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
apache/maven-executor#45 ·
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