Repository navigation
feat(backends): dial backends over UNIX domain sockets - #1892
Merged
Merged
Conversation
A backend can now declare `unix_path`: an absolute filesystem path, or `@name` for a Linux abstract-namespace socket. HTTP, HTTPS and TCP clusters dial that socket instead of `address`, which stays the backend's identity (removal, retry exclusion, hash and shard placement, events) and must be unique in its cluster. UDP clusters refuse it. The field is additive everywhere: `AddBackend.unix_path` (proto field 7), the `response::Backend` state record so replays and saved states keep it, `BackendConfig.unix_path` in the configuration file, and `sozu backend add --unix-path`. `parse_backend_unix_path` is the one validator used at config load, by the main process state and by every worker. `connect_backend` dials the UNIX stream with mio and hands its descriptor to the pipeline as a `mio::net::TcpStream`, so the H1, H2, TCP and WebSocket paths take it without a generic stream type. Every syscall they make on a backend socket answers the same way on AF_UNIX, except std's `peer_addr`, which refuses a non-INET peer: the two connect-completion checks (`connect_outcome`, `tcp_connect_outcome`) now use `socket2`'s family-agnostic `getpeername`, and TCP_NODELAY is skipped for unix backends. Health checks probe through the same dial. Tests: unit tests for the parser, the config and state round trip, the dial and both connect-outcome checks (red with std `peer_addr`, green with the fix), and e2e tests for HTTP over a path and an abstract socket and for TCP passthrough over a path socket. Closes #152 Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
marked this pull request as ready for review
October 15, 2026 14:59
Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
marked this pull request as draft
October 15, 2026 15:36
Signed-off-by: Florentin Dubois <[email protected]>
Signed-off-by: Florentin Dubois <[email protected]>
Collaborator
Author
|
Heads-up from #1899, which adds an optional probe |
FlorentinDUBOIS
marked this pull request as ready for review
October 15, 2026 17:11
Signed-off-by: Florentin Dubois <[email protected]>
Signed-off-by: Florentin Dubois <[email protected]>
Merge the current backend ownership, close-session, and DNS configuration changes into UNIX socket backends. Preserve unix_path through literal and expanded backend configuration, validate identities after resolution, and cover a real DNS-named backend that dials only its UNIX socket. Refs #152 Signed-off-by: Florentin Dubois <[email protected]>
Preserve the fail-closed wire verbs and canonical request handling from header routing while carrying UNIX socket transports through DNS-expanded configuration. Refs #152 Signed-off-by: Florentin Dubois <[email protected]>
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.
Support stream backends over UNIX domain sockets, including Linux abstract sockets (
@name), while retaining existing IP backend behavior. Configuration carries the socket path through state and workers; UDP rejects UNIX stream targets before mutation. Canonical UNIX-backend requests use protobuf verb 72 so older decoders cannot accidentally dial the identity IP address.Validation: focused UNIX/abstract-socket end-to-end tests, state/command tests, old-decoder and UDP refusal RED/GREEN checks, formatting and Clippy. Independent source and final documentation reviews approved the current head. The full GitHub Actions matrix must succeed before merge.
Closes #152