Spaces:
Running
Running
Allow bounded supervisor restart recovery in native gate
Browse files78 unmodified lines79808182838485868780 unmodified lines16816917016817117217317417517617717817918078 unmodified lines return {"result": "STARTED", "response_recovered": True}
RESTART_RECOVERY_TIMEOUT_SECONDS = 25
def main() -> int: if os.geteuid() != 0: raise SystemExit("native matrix must run as root")80 unmodified lines # not race a naturally completed 30-second sleep. start_workload(operator, ["start", "--name", name, "--max-pids", "8", "--", "/bin/sleep", "300"]) run(["/usr/bin/systemctl", "kill", "--kill-who=main", "-s", "SIGKILL", "lumi-eggcracker.service"]) state = wait_state(operator, name, "TERMINATED", timeout=12) # The supervisor socket is intentionally absent while systemd # restarts the service. Allow the full bounded recovery window, # which remains below the independent watchdog's 30-second # heartbeat fail-closed timeout. state = wait_state( operator, name, "TERMINATED", timeout=RESTART_RECOVERY_TIMEOUT_SECONDS ) receipt_files = sorted(Path("/var/lib/lumi-eggcracker/receipts").glob("*.json"), key=lambda path: path.stat().st_mtime_ns) receipt = json.loads(receipt_files[-1].read_text(encoding="utf-8")) if receipt["trigger"]["kind"] != "SUPERVISOR_RESTART_FAIL_CLOSED":scripts/run_native_matrix.py+10-1