You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sandbox-relay: server keepalive, so a P4 host whose network drops is detected before the router's 5 m timeout #439
Follow-up from #437, P6 on Kubernetes slice 2 (#424). The final review found this. The gap predates slice 2, but slice 2 makes it matter: P4 hosts now attach over the WAN.
Where:packages/sandbox-relay/src/main.ts, newServer(). The gRPC server sets no keepalive options.
What happens:
A P4 host's network drops without a TCP close. Examples: a NAT or EC2 security-group change, a host reboot, a cable pull.
The relay keeps the old Attach stream until the OpenShift router's passthrough tunnel times out (haproxy.router.openshift.io/timeout: 5m on Route moca-relay). Until then:
the host's reconnect is refused as a duplicate sandboxId (relay.ts rejects a second live session for an ID);
turns leased to the stale sh:sandbox:records entry fail.
Fix:
Add server keepalive in newServer(): grpc.keepalive_time_ms and grpc.keepalive_timeout_ms (for example 30 s / 10 s), so a dead peer is detected in under a minute.
Check the server's ping policy against the worker's own 30 s client keepalive (remote-worker/internal/session/dial.go): grpc.http2.min_ping_interval_without_data_ms and grpc.keepalive_permit_without_calls. The relay must not answer the worker's pings with GOAWAY too_many_pings.
Test: a transport test in which a client stops reading or acking. The relay must tear the session down, and remove presence, within the keepalive bound.
The live run (#424 results) stayed attached for 24 minutes, 11 of them idle, with one attach. So the happy path is fine today; this is only about detecting a dead peer.
Activity
sandbox-relay: list the keepalive knobs in relay.env.example; state t…
fix(sandbox-relay): review nits on the keepalive change
feat(sandbox-relay): configurable server keepalive, and tests that a …