Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Carry #3985 Part I] code refactor for process sync #4003

Merged
merged 2 commits into from
Oct 3, 2023

Commits on Sep 24, 2023

  1. sync: rename procResume -> procHooksDone

    The old name was quite confusing, and with the addition of the
    procMountPlease sync message there are now multiple sync messages that
    are related to "resuming" runc-init.
    
    Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
    cyphar authored and lifubang committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    ccc7671 View commit details
    Browse the repository at this point in the history
  2. sync: split init config (stream) and synchronisation (seqpacket) pipes

    We have different requirements for the initial configuration and
    initWaiter pipe (just send netlink and JSON blobs with no complicated
    handling needed for message coalescing) and the packet-based
    synchronisation pipe.
    
    Tests with switching everything to SOCK_SEQPACKET lead to endless issues
    with runc hanging on start-up because random things would try to do
    short reads (which SOCK_SEQPACKET will not allow and the Go stdlib
    explicitly treats as a streaming source), so splitting it was the only
    reasonable solution. Even doing somewhat dodgy tricks such as adding a
    Read() wrapper which actually calls ReadPacket() and makes it seem like
    a stream source doesn't work -- and is a bit too magical.
    
    One upside is that doing it this way makes the difference between the
    modes clearer -- INITPIPE is still used for initWaiter syncrhonisation
    but aside from that all other synchronisation is done by SYNCPIPE.
    
    Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
    cyphar authored and lifubang committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    8da42aa View commit details
    Browse the repository at this point in the history