Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Zipapp doesn't forward signals (SIGTERM and friends) to the process, resulting in orphaned processes and no cleanup

Aperta
#3,809 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
build-system

Direzione di ricerca

Inizia da python/private/zipapp/zip_main_template.py, intorno alle righe 279-281, quindi riproduci il problema con il programma Python fornito per la gestione dei segnali. Confronta bazel run con l'esecuzione della zipapp compilata e verifica che SIGTERM raggiunga il processo sottostante e consenta la pulizia senza lasciarlo orfano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🐞 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?

Lingua principale
Starlark
Stelle
690
Fork
722
Merge medio
1g 55m
PR unite (30g)
38

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bazel-contrib/rules_python

Tutte le issue di bazel-contrib/rules_python

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.