def pause_pipeline(self, run_id, user):
"""
Interrupt pipeline by sending signal to corresponding worker's children
"""
pid = self.pids.get(run_id)
if pid:
pretty_print("Pausing pipeline: id=%d, user=%s" % (run_id, user))
try:
parent = psutil.Process(pid)
children = parent.children(recursive=True)
for child in children:
run_as(cmd=['kill', child.pid], user=user)
except psutil.NoSuchProcess:
pretty_print("Error pausing pipeline: no process with ID %d" % int(pid))
else:
pretty_print("Error pausing pipeline: ID %d not found" % run_id)
评论列表
文章目录