Forked executor leaves the process tree behind on timeout
まだ誰も着手していません。
評価
- 難易度
- 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
- フォーク
- 2
- 平均マージ
- 4時間 22分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/maven-executor のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/maven-executor#46 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
apache/maven-executor#50 ·
-
enhancement priority:major
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
apache/maven-executor#49 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
apache/maven-executor#47 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
apache/maven-executor#45 ·
apache/maven-executor の issue をすべて見る
似ている issue
-
link-check link-check:manual
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
open-telemetry/opentelemetry-java#8870 ·
メンテナーはふだん 1 日以内に返信
-
P2 testing
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
enhancement javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area/core kind/bug status/triage team/core-shared
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信