common.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:clusterfuzz-tools 作者: google 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号