MCPcopy Create free account
hub / github.com/AnswerDotAI/ModernBERT / kill_process_tree

Function kill_process_tree

run_evals.py:72–84  ·  view source on GitHub ↗
(pid)

Source from the content-addressed store, hash-verified

70
71
72def kill_process_tree(pid):
73 try:
74 parent = psutil.Process(pid)
75 children = parent.children(recursive=True)
76 for child in children:
77 child.terminate()
78 gone, still_alive = psutil.wait_procs(children, timeout=5)
79 for p in still_alive:
80 p.kill()
81 parent.terminate()
82 parent.wait(5)
83 except psutil.NoSuchProcess:
84 pass
85
86
87def signal_handler(signum, frame):

Callers 1

signal_handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected