INNER CODE UNIT · Python

_terminate_process_group

lij768423-svg/grok-register-panel · batch_supervisor.py:182

def _terminate_process_group(process: subprocess.Popen, grace_seconds: float = 5.0) -> None:
    if process.poll() is not None:
        return
    try:
        if os.name == "posix":
            os.killpg(process.pid, signal.SIGTERM)
        else:  # pragma: no cover - exercised through the injected unit test
            _terminate_windows_process_tree(process, grace_seconds)
            return
    except ProcessLookupError:
        return
    try:
        process.wait(timeout=max(0.1, grace_seconds))
        return
    except subprocess.TimeoutExpired:
        pass
    try:
        if os.name == "posix":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…