Skip to content

relay: reach mdsip over a Unix socket (socket=), image listens on FDP_MDSIP_SOCKET - #20

Merged
sammuli merged 8 commits into
mainfrom
relay-unix-socket
Oct 13, 2026
Merged

sammuli merged 8 commits into
mainfrom
relay-unix-socket

Conversation

@sammuli

@sammuli sammuli commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • http.exthandler ... socket=/path makes the relay connect AF_UNIX; host=/port= stay the default and socket= with either is refused at load. port= is now strict (trailing text refused).
  • fdp-mdsip-server listens on UNIX-LISTEN:$FDP_MDSIP_SOCKET,fork,unlink-early,mode=666 when the variable is set; TCP otherwise. Build-time assertions cover both listener lines.
  • Why: on d3d-origin the sandbox is rootless and the TCP hop into it crosses pasta, where every reply above ~4 MB waits out a 200 ms RTO (\psirz 240-775 ms against 17 ms on atlas). Design and measurements: d3d-origin-admin docs/specs/2026-10-13-mdsip-unix-socket-design.md; plan docs/plans/2026-10-13-mdsip-unix-socket.md.

Test plan

  • unit: ResolveMdsipTarget (defaults, TCP, Unix, both-forms refusal, port range and trailing text, path length); MdsipSessions over a Unix socket; absent socket and over-long path fail naming the cause (22 cases)
  • run_relay_e2e.sh TCP and RELAY_SOCKET=/tmp/fdp-relay-e2e.sock: banner asserted per mode, all sections, new 6b large-reply check (medians ~27 ms), leak counter 1/1/1
  • CI, then release-0.3.5; both images' labels

Follow-ups (not in this PR)

  • scripts/mdsip-sandbox.sh has no socket mode, so the harness exercises the relay's socket= path against the host stand-in, not the container's FDP_MDSIP_SOCKET branch; the harness refuses RELAY_SOCKET with MDSIP_SANDBOX for that reason. The production acceptance table in the design doc is the gate until the sandbox script learns the socket form.
  • idle=, timeout=, maxsessions= are still parsed with unchecked atoi/strtoul.

🤖 Generated with Claude Code

sammuli and others added 8 commits October 13, 2026 13:17
…socket

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…connection forms

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
host= and port= remain the default. port= is now strict: trailing text
such as port=80abc, which std::atoi read as 80, is refused at load.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… tests the socket form

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e sandbox flag; mode=666 asserted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…log quirk

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sammuli
sammuli merged commit b1e6ec9 into main Oct 13, 2026
4 checks passed
@sammuli
sammuli deleted the relay-unix-socket branch October 13, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant