runner_common.py 文件源码

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

项目:nodenative 作者: nodenative 项目源码 文件源码
def _ParallelSymbolizeBacktrace(backtrace):
  # Disable handling of SIGINT during sub-process creation, to prevent
  # sub-processes from consuming Ctrl-C signals, rather than the parent
  # process doing so.
  saved_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
  p = multiprocessing.Pool(multiprocessing.cpu_count())

  # Restore the signal handler for the parent process.
  signal.signal(signal.SIGINT, saved_sigint_handler)

  symbolized = []
  try:
    result = p.map_async(_SymbolizeEntry, backtrace)
    symbolized = result.get(SYMBOLIZATION_TIMEOUT_SECS)
    if not symbolized:
      return []
  except multiprocessing.TimeoutError:
    return ['(timeout error occurred during symbolization)']
  except KeyboardInterrupt:  # SIGINT
    p.terminate()

  return symbolized
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号