Skip to content

ws: substrate doesn't call StartHeartbeat() on accepted child connections #140

Description

@TickTockBent

Follow-up from PR #136 review.

Problem

Only the transient side starts the WS heartbeat after attach (tree/manager.go:585, cmd/repram/main.go:306). On the substrate side, bindWSConnection accepts the connection and dispatches gossip but never calls conn.StartHeartbeat().

Consequence: half-open child sockets are only detected when the transient's heartbeat dies. The substrate has no proactive liveness check on its inbound side and will hold dead child entries (in children map + ACK route table memory) until the transient eventually notices and reconnects, or until the OS gives up on the TCP flow.

Fix

In cmd/repram/main.go:bindWSConnection, after a successful HandleHello, call conn.StartHeartbeat() so the substrate also pings and tears down on missed pongs.

Acceptance

  • Substrate-side heartbeat runs on every attached child
  • Forcing the transient process to disappear (SIGKILL) causes the substrate to evict the child within ~2 heartbeat intervals
  • Test coverage in cmd/repram/ws_integration_test.go

// ticktockbent

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgoPull requests that update go code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions