Forked executor leaves the process tree behind on timeout
维护者通常 5 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- build-system
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Java
- 星标
- 5
- 派生
- 4
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/maven-executor 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
apache/maven-executor#20 ·
维护者通常 5 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
apache/maven-executor#19 · 1 条评论 ·
维护者通常 5 天内回复
-
documentation
难度 3/5 1-2 天 新手友好度 64/100
apache/maven-executor#18 ·
维护者通常 5 天内回复
-
bug
难度 5/5 一周以上 新手友好度 20/100
apache/maven-executor#16 · 1 条评论 ·
维护者通常 5 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
apache/maven-executor#1 · 1 条评论 ·
维护者通常 5 天内回复
查看 apache/maven-executor 的全部 Issue
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
devops-thiago/ThrillhouseBot#1132 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
approved bug
难度 2/5 1-3 小时 新手友好度 70/100
checkstyle/checkstyle#21981 · 1 条评论 ·
维护者通常 1 天内回复
-
Build: the CUDA backend fails without cuDNN instead of skipping the cuDNN shim (as the cuDF shim does)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
beehive-lab/TornadoVM#1248 ·
维护者通常 1 天内回复
-
good first issue help wanted ready-for-human
难度 2/5 半天 新手友好度 64/100
维护者通常 1 天内回复