Disconnectable Links #2
Draft
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.
Make the default setting for fd-based and xdp-based links default to 'disconnectable'
Newly created links (whether fd-based or xdp-based) have options that indicate whether they are disconnectable, meaning that either the sandboxed application or the host system can close or terminate the communication channel.
By default, this is set to False, meaning that when TCP connections are established within a sandbox, and a runsc checkpoint is called, the kernel panics and throws (see
pkg/tcpip/transport/tcp/endpoint_state.go, line 44). In general, this is a sensible thing to do since the connections cannot be saved.However, if you wish to simply drop these connections when calling a runsc checkpoint, you are happy to simply have the SaveRestore option set to
false, but the DisconnectOk option set totrue.We set these flags in the runsc/boot/network.go file, in the CreateLinksAndRoutes function that should only be called once. This is probably preferable to hardcoding the capability to true in fdbased/endpoint.go and xdp/endpoint.go.
For more context on how this approach was determined see: google#113