Repository navigation
internal/pipeproxy: named pipe to engine transport - #18
Merged
Merged
Conversation
The load-bearing component, transport layer only. Byte-for-byte fidelity is what makes hijacked connections work, so this layer knows nothing about HTTP; bind-path rewriting layers on via OnAccept in a follow-up. - Relay: bidirectional copy with half-close propagation in both directions, so a client can send a body, half-close, and still read the response (the docker build / docker save shape) - Server.Serve: concurrent connections, graceful drain, and shutdown that closes live connections rather than waiting on them - Listen (windows): go-winio pipe with an explicit SDDL - SYSTEM, administrators, interactive users. Byte mode, not message mode: message framing truncates large payloads, which is how image pulls break. - WSLDialer: one wsl.exe+socat per connection, the v0.1 design Spike A validated; closing stdin is a true half-close, and Close reaps the child so a busy client cannot leave zombie processes A shutdown bug surfaced while writing the real-pipe test: Serve waited for in-flight connections, so any streaming client (docker logs -f) would have pinned service shutdown forever. Serve now tracks live connections and closes them on cancellation; the test that caught it went from a 5s hang to 0.01s and is kept as a regression guard. 14 tests, 70% coverage. The Dialer seam means the transport is verified without WSL2, while the pipe tests exercise the real Windows transport stock docker.exe uses. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Toward #6 — the transport layer of the load-bearing component. HTTP-level bind-path rewriting (using the
winpathpackage from #17) layers on top viaOnAcceptin a follow-up PR; keeping them separate because their tests are entirely different in character, and this half is what everything else depends on.Deliberately HTTP-oblivious. Byte-for-byte fidelity is what makes hijacked connections (
exec -it,attach) work at all, so nothing here parses a request.Relay— bidirectional copy with half-close propagated in both directions, so a client can send a body, half-close, then read the response. That''s thedocker build/docker saveshape, and the thing naive relays truncate.Server.Serve— concurrent connections, graceful drain, and shutdown that closes live connections instead of waiting on them.Listen(Windows) — go-winio pipe with an explicit SDDL: SYSTEM, administrators, interactive users. Explicit because a service running as SYSTEM would otherwise own the pipe and lock the logged-in user out. Byte mode, not message mode — message framing truncates large payloads, which is how image pulls break.TODO(#8)marks where the localHawser Usersgroup SID replacesIU.WSLDialer— onewsl.exe+socat per connection, the v0.1 design Spike A validated. Closing stdin is a genuine half-close, andClosereaps the child so a busy client can''t leave zombiewsl.exeprocesses behind.A real bug surfaced while writing the real-pipe test.
Servewaited for in-flight connections to finish — so any streaming client (docker logs -f,docker events) would have pinned service shutdown forever. The test hung for 5s and failed.Servenow tracks live connections and closes them on cancellation; that test is kept asTestServeShutsDownWithStreamingClientand now passes in 0.01s. Worth calling out because it would have shown up as "stopping the Hawser service hangs" long after the fact.14 tests, 70% coverage. The
Dialerseam verifies transport behavior with no WSL2 (half-close, streaming, 256 KB binary round-trip, 25 concurrent connections, dial failure), while the Windows tests drive a real named pipe through go-winio — the same transport stockdocker.exeuses.🤖 Generated with Claude Code