def kill(proc):
"""Kill a process multiple times.
See: https://github.com/google/clusterfuzz-tools/pull/301"""
try:
for sig in [signal.SIGTERM, signal.SIGTERM,
signal.SIGKILL, signal.SIGKILL]:
logger.debug('Killing pid=%s with %s', proc.pid, sig)
# Process leader id is the group id.
os.killpg(proc.pid, sig)
# Wait for any shutdown stacktrace to be dumped.
time.sleep(3)
raise error.KillProcessFailedError(proc.args, proc.pid)
except OSError as e:
if e.errno != NO_SUCH_PROCESS_ERRNO:
raise
评论列表
文章目录