INNER CODE UNIT · Python

run_supervisor

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

def run_supervisor(
    count: int,
    workers: int,
    child_command_builder: Callable[[int, int], Sequence[str]],
    *,
    progress_file: str | os.PathLike[str],
    idle_timeout: float = DEFAULT_IDLE_TIMEOUT,
    max_restarts: int = DEFAULT_MAX_RESTARTS,
    child_env: Mapping[str, str] | None = None,
    non_retryable_exit_codes: Sequence[int] = tuple(NON_RETRYABLE_EXIT_CODES),
) -> int:
    """Run a batch child and restart the remaining work after a driver crash."""
    target = max(1, int(count))
    worker_count = max(1, min(24, int(workers), target))
    progress_path = initialize_progress(progress_file, target)
    stop_requested = False
    active_process: subprocess.Popen | None = None
    restarts = 0

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…