MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / stop

Method stop

server/scripts/phase_split_dual_gpu.py:166–190  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 return tokens, time.perf_counter() - t0
165
166 def stop(self) -> None:
167 if self.proc is None:
168 return
169 try:
170 if self.proc.stdin:
171 self.proc.stdin.write(b"quit\n")
172 self.proc.stdin.flush()
173 self.proc.stdin.close()
174 except Exception:
175 pass
176 try:
177 self.proc.wait(timeout=10)
178 except subprocess.TimeoutExpired:
179 self.proc.terminate()
180 try:
181 self.proc.wait(timeout=5)
182 except subprocess.TimeoutExpired:
183 self.proc.kill()
184 self.proc.wait()
185 if self.r_fd is not None:
186 try:
187 os.close(self.r_fd)
188 except OSError:
189 pass
190 self.proc = None
191
192
193class GpuMonitor:

Callers 1

run_casesFunction · 0.95

Calls 3

writeMethod · 0.80
killMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected