Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

sandbox-relay: server keepalive, so a P4 host whose network drops is detected before the router's 5 m timeout

Open
#439 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
grpc, typescript
Domain
networking

Research direction

Start with packages/sandbox-relay/src/main.ts and newServer() to inspect the server's gRPC options, then compare them with the worker keepalive settings in remote-worker/internal/session/dial.go and duplicate-session handling in relay.ts. Add the transport test described in the issue. Done means a dead peer is detected within the keepalive bound, the session is torn down, presence is removed, and the worker's pings do not trigger GOAWAY too_many_pings.

Written by the indexing model from the issue text.

Description

enhancement

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:

  1. A P4 host's network drops without a TCP close. Examples: a NAT or EC2 security-group change, a host reboot, a cable pull.
  2. 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.

Dominant language
TypeScript
Stars
4
Forks
9
Avg merge
9h 31m
Merged PRs (30d)
139

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rossoctl/moca

All issues in rossoctl/moca

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.