Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Forked executor leaves the process tree behind on timeout

已关闭
#48 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

@slachiewicz 已经在做这个了。

开始于 2026年10月3日。

  • #56 来自 @efegokdemir —— 已关闭,未合并
  • #64 来自 @slachiewicz —— 未关闭

评估

难度
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 内容生成。

描述

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.

主要语言
Java
星标
5
派生
4
平均合并
3 天 2 小时
30 天内合并 PR
4

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/maven-executor 的其他 Issue

查看 apache/maven-executor 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。