refactor: replace raw-byte sync protocol with typed message channel#188
Merged
Conversation
fmt::format_to eliminates per-arg std::string allocation; ioctl and prctl error messages use the new append_arg helper. Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
send, recv, sendmsg, recvmsg, connect all retry on EINTR. Return errno-based result types with explicit operator bool. Signed-off-by: Yuming He <ComixHe1895@outlook.com>
… layer New layering: os:: -> infra::unix_socket (SCM_RIGHTS) -> protocol::message_channel (typed std::variant messages over SEQPACKET). Consolidates old socket.h and unix_socket.h into purpose-built infra/protocol modules with parent/child role separation and explicit wait_for stages. Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Replace raw-byte sync protocol with typed message_channel (parent/child roles): - namespace/createruntime/createcontainer/exec handshakes -> stage enum - console_fd travels over sync channel via SCM_RIGHTS (removes extra socketpair) - exec_ready + close/die replaces STARTCONTAINER_HOOKS sentinel + raw close - terminal_master::get() and terminal_slave::file_describer() -> fd() - container_monitor param renamed from master to pty (fixes member shadowing) Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
28 tests covering: - serialize/deserialize wire format for all 5 message types - fd transfer with SCM_RIGHTS (count and fstat validity) - parent/child role semantics: wait_for, wait_for_exec phases, proceed handshake - error paths: unknown msg_id, unknown stage type, empty fds, fd limit, report_error on closed socket Signed-off-by: Yuming He <ComixHe1895@outlook.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.
No description provided.