wip(k1): checkpoint connection recovery rewrite

Capture the current unreleased K1 connection, recovery, lifecycle, viewer, and test work as a single known-bad baseline for subsequent fixes.
This commit is contained in:
DCCONSTRUCTIONS
2026-08-14 14:57:50 +03:00
parent aff331082f
commit 0ca7316a24
157 changed files with 152962 additions and 4036 deletions
+14 -2
View File
@@ -1,5 +1,6 @@
from __future__ import annotations
import errno
import logging
import math
import socket
@@ -86,8 +87,19 @@ def _select_available_grpc_port(
# Rerun binds all local interfaces. Probe the same address class
# so a previous recording retained by a late viewer is detected.
probe.bind(("0.0.0.0", candidate))
except OSError:
continue
except OSError as exc:
if exc.errno == errno.EADDRINUSE:
continue
if exc.errno in {errno.EACCES, errno.EPERM}:
raise PermissionError(
exc.errno,
"Permission denied while probing local Rerun gRPC "
f"port {candidate}",
) from exc
raise RuntimeError(
"Could not probe local Rerun gRPC "
f"port {candidate}: {type(exc).__name__}: {exc}"
) from exc
return candidate
raise RuntimeError(
"No local Rerun gRPC port is available in "