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:
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user