Repository navigation
fleet-proxy: colocated UDS dialing in direct mode (#6219) - #8388
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01c39367fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let Some(fleet_config::RoleTransport::Socket(socket)) = | ||
| self.config.service_transport_choice(port) | ||
| { | ||
| if let Ok(stream) = UnixStream::connect(&socket) { |
There was a problem hiding this comment.
Bound the Unix-socket probe and dial by the setup deadline
In direct mode, if a broker's Unix listener stops accepting and its backlog fills, this path can block indefinitely instead of falling back to TCP. Both the probe inside service_transport_choice() and the subsequent UnixStream::connect() use blocking connects without a deadline; the read/write timeouts installed afterward cannot bound connection establishment. Previously, direct connections went through connect_tunnel(), which enforces the two-second TRANSPORT_DEADLINE. Bound both the probe and actual socket dial, and reach the TCP fallback when that budget expires.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 28f1625 — thank you, the point stands on both connects.
- The dial path no longer calls
service_transport_choice()(whose probe connect was unbounded). It now uses the new probe-freeConfig::service_socket_resolution(port)(socket path + configured transport preference; atcppreference still skips the socket). - The dial itself is the probe, and it is bounded:
connect_unix_boundedrunsUnixStream::connecton a scratch thread and waits onlyTRANSPORT_DEADLINE(the same 2s budgetconnect_tunnelenforces). On expiry or error the caller falls back to the TCP dial within the same attempt; the read/write timeouts are then installed on the connected stream as before.
Re-verified: cargo test -p fleet-config -p fleet-proxy — all suites pass (38 + 80 + 14).
Closes #6219.
Implements colocated fleet-proxy port-to-socket UDS dialing in direct mode (from the #5699 design):
Config::service_socket(port)andConfig::service_transport_choice(port)— port-to-socket resolution besideConfig::services(), derived from the same port-keyed table. Broker-role ports (4800 secrets-broker, 4801 queue-broker) resolve to their role sockets; the laptop-agent port and unrouted ports resolve toNone. The hello/services wire contract is unchanged (port-keyed map, byte-identical).HttpConn: generalized over aConnStream(TCP tunnel stream or Unix socket) so the same HTTP exchange rides either transport.open_conn_raw: in direct mode only, when the port's service transport choice is a socket, dial the Unix socket (with the tunnel read/write timeouts); a socket that does not answer falls back to the TCP dial in the same attempt. Non-direct (tunnel/egress) path and non-colocated ports are unchanged — no configuration changes needed.Tests (oracle: the #6219 acceptance criteria):
fleet-config:service_socket_resolves_broker_ports_only— broker ports resolve, laptop-agent/unrouted ports do not.fleet-proxy:unix_socket_round_trips_and_stays_reusable— a full HTTP exchange over a real Unix socket.cargo test -p fleet-config -p fleet-proxy— 38 + 80 + 14 passed, 0 failed.Queue: task 11385, lane code-w.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.