Move Unix domain sockets into the broker - #1493
Open
Weidong Cui (wdcui) wants to merge 2 commits into
Open
Weidong Cui (wdcui) wants to merge 2 commits into
Weidong Cui (wdcui) wants to merge 2 commits into
Conversation
Unix domain sockets become guest-neutral broker-owned local sockets, so they can be shared across processes and inherited across fork and exec. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ceea8bb3-229a-4415-a471-bb3b41d4fed0
Copy Unix socket addresses truncated to the caller's buffer like Linux, which previously underflowed when addrlen was below 2, and raise SIGPIPE only for Unix stream sockets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ceea8bb3-229a-4415-a471-bb3b41d4fed0
|
🤖 SemverChecks 🤖 Click for details |
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.
This PR moves Unix domain sockets from the runner-local shim implementation into the broker as guest-neutral local sockets, so they can be shared across processes and inherited across fork and exec, which previously refused Unix socket fds. It adds the local socket protocol and wire codec, a broker-core socket table (path names bound as files in the broker filesystem with write-permission checks on connect, abstract names keyed per socket type, listen backlogs, stream and datagram queues charged against per-process and global byte quotas including unaccepted connections, shutdown, readiness, timeouts, and shared status flags), host dispatch and handle duplication, the
BrokerLocalclient, and aLocalSocketfacade inlitebox. The Linux shim's Unix socket support is rewritten as a thin wrapper over that facade (removingchannel.rsand the shim address table), Unix socket fds are inherited across fork and exec,read/readv/writevon Unix datagram sockets now preserve datagram boundaries, Unix socket addresses returned to the guest are truncated to the caller's buffer like Linux (anaddrlenbelow 2 previously underflowed), and anEPIPEon a Unix datagram socket no longer raisesSIGPIPE. Broker-core and shim unit tests cover the new semantics, and a new runner test checks that forked and exec'd children share stream, datagram, and path-bound listening sockets with their parent.