This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
sandbox: refactor to integrate new network stack #180
Merged
Merged
Conversation
This file contains 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
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
chriso
approved these changes
Jul 22, 2023
…rom the host Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Still a work in progress as I have a few tests that are disabled but the big chunk of the work is done.
The PR integrates the first pass I took in the
internal/network
package intointernal/sandbox
; as a reminder, the intent here is to create a virtual network between processes spawned by timecraft so they can connect.I moved all the files into
internal/sandbox
, getting rid of theinternal/network
package because there were too many platform-specific dependencies in both that felt like implicit dependencies between the source files, keeping them together seemed like a better approach.One key change is I ended implementing blocking mode in the sockets: when used in blocking mode, the sockets duplicate their file descriptors and create an
*os.File
with the dup fd. The*os.File
is used to interact with the Go net poller: when blocking operations are performed, it usessyscall.RawConn
to block the goroutine on I/O, preventing the creation of threads if the guest modules were blocking on a syscalls (e.g. accept/connect/recv/send).