MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / quiesce

Function quiesce

tests/test_coverage_children.py:97–111  ·  view source on GitHub ↗
(proc)

Source from the content-addressed store, hash-verified

95
96
97def quiesce(proc):
98 # Every spawned process is the leader of its own new session/group. Nested
99 # reducer tools inherit that group. C fixtures separately prove native reaps.
100 notes = []
101 for sig in (signal.SIGTERM, signal.SIGKILL):
102 if proc.poll() is not None and not group_exists(proc.pid):
103 return True, notes
104 signal_group(proc.pid, sig)
105 notes.append("sent " + signal.Signals(sig).name)
106 until = time.monotonic() + GRACE
107 while time.monotonic() < until:
108 if proc.poll() is not None and not group_exists(proc.pid):
109 return True, notes
110 time.sleep(min(0.05, max(0, until - time.monotonic())))
111 return proc.poll() is not None and not group_exists(proc.pid), notes
112
113
114def run_process(directory, label, argv, environment):

Callers 2

run_processFunction · 0.85

Calls 3

group_existsFunction · 0.85
signal_groupFunction · 0.85
pollMethod · 0.45

Tested by

no test coverage detected