Zipapp doesn't forward signals (SIGTERM and friends) to the process, resulting in orphaned processes and no cleanup
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
- 領域
- build-system
調査の方向性
まず python/private/zipapp/zip_main_template.py の279~281行目付近から始め、次に提供されたシグナル処理用のPythonプログラムで問題を再現します。bazel run とビルドされたzipappの実行を比較し、SIGTERMが下位プロセスに到達してクリーンアップを可能にし、そのプロセスを孤立させずに済むことを確認します。
索引モデルが issue の本文から書いたものです。
説明
🐞 bug report
Affected Rule
The issue is caused by the rule: `py_binary`Is this a regression?
Yes, the previous version in which this bug was not present was: ....Unsure
Description
A clear and concise description of the problem...When running a py_binary zipapp (E.g. bazel build --build_python_zip <tgt>) signals such as SIGTERM aren't forwarded to the binary itself, meaning the process doesn't get a chance to clean up.
I suspect https://github.com/bazel-contrib/rules_python/blob/25ad57c85f0094889520486cd9a5738278fd0541/python/private/zipapp/zip_main_template.py#L279-L281 is the source of the issue
🔬 Minimal Reproduction
Given
import signal
signal.signal(signal.SIGTERM, lambda _1, _2: print("SIGTERM"))
while True:
pass
Then bazel run <tgt> and a kill -s TERM <pid> will print SIGTERM. But bazel build --build_python_zip <tgt> followed by a python <tgt>.zip and a kill -s TERM <pid> (of the outer process) results in the process being terminated and the underlying process being orphaned 💔
🔥 Exception or Error
N/A
🌍 Your Environment
Operating System:
x64 Ubuntu
Output of bazel version:
Build label: 8.6.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Feb 26 19:55:20 2026 (1772135720)
Build timestamp: 1772135720
Build timestamp as int: 1772135720
Rules_python version:
1.9.0
Anything else relevant?
- 主要言語
- Starlark
- スター
- 690
- フォーク
- 722
- 平均マージ
- 1日 55分
- マージ済み PR(30日)
- 38
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bazel-contrib/rules_python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bazel-contrib/rules_python#4179 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bazel-contrib/rules_python#4164 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bazel-contrib/rules_python#3821 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
bazel-contrib/rules_python#4181 ·
-
Release 2.4.0 オープンtype: release
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bazel-contrib/rules_python#4175 · コメント 3 件 ·
bazel-contrib/rules_python の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
typelevel/sbt-typelevel#929 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
openSUSE/python-rpm-macros#219 ·
-
HMR stops working オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
Qiskit/mcp-servers#221 ·