[molecule.utils] remove RUNNING_PIDS set
This ill conceived idea of killing stale chroot child processes does more harm than good and the idea has been inherited long time ago from the Catalyst codebase. Chroot processes are responsible of their cleanup.
This commit is contained in:
@@ -25,11 +25,6 @@ sys.path.insert(0,'molecule/')
|
||||
sys.path.insert(0,'.')
|
||||
import molecule.cmdline
|
||||
from molecule.handlers import Runner
|
||||
from molecule.utils import RUNNING_PIDS
|
||||
|
||||
def kill_pids():
|
||||
for pid in RUNNING_PIDS:
|
||||
os.kill(pid, signal.SIGTERM)
|
||||
|
||||
parse_data = molecule.cmdline.parse()
|
||||
if parse_data is None:
|
||||
@@ -46,12 +41,10 @@ for el in molecule_data_order:
|
||||
except KeyboardInterrupt:
|
||||
while True:
|
||||
my.kill()
|
||||
kill_pids()
|
||||
break
|
||||
raise SystemExit(1)
|
||||
while True:
|
||||
my.kill()
|
||||
kill_pids()
|
||||
break
|
||||
if rc != 0:
|
||||
raise SystemExit(rc)
|
||||
|
||||
@@ -31,8 +31,6 @@ random.seed()
|
||||
|
||||
from molecule.compat import convert_to_rawstring
|
||||
|
||||
RUNNING_PIDS = set()
|
||||
|
||||
|
||||
def get_year():
|
||||
"""
|
||||
@@ -153,9 +151,7 @@ def exec_chroot_cmd(args, chroot, pre_chroot = None, env = None):
|
||||
myargs = pre_chroot+args
|
||||
os.execvp(myargs[0], myargs)
|
||||
else:
|
||||
RUNNING_PIDS.add(pid)
|
||||
rcpid, rc = os.waitpid(pid, 0)
|
||||
RUNNING_PIDS.discard(pid)
|
||||
return rc
|
||||
|
||||
def kill_chroot_pids(chroot, sig = signal.SIGTERM, sleep = False):
|
||||
|
||||
Reference in New Issue
Block a user