-
Notifications
You must be signed in to change notification settings - Fork 34
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
Forker process #489
Merged
Forker process #489
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
Closed
rosds
force-pushed
the
fork
branch
2 times, most recently
from
January 25, 2022 17:38
329ff00
to
11e1bfc
Compare
flxo
force-pushed
the
fork
branch
2 times, most recently
from
January 26, 2022 10:26
4e42e6a
to
36aa0df
Compare
rosds
force-pushed
the
fork
branch
6 times, most recently
from
January 31, 2022 16:19
4d1448b
to
5411d42
Compare
rosds
commented
Jan 31, 2022
rosds
commented
Jan 31, 2022
rosds
force-pushed
the
fork
branch
2 times, most recently
from
February 1, 2022 17:34
c7a5689
to
e3cd25b
Compare
Closed
flxo
force-pushed
the
fork
branch
5 times, most recently
from
February 11, 2022 09:45
7661d8d
to
321abd6
Compare
rosds
force-pushed
the
fork
branch
4 times, most recently
from
February 21, 2022 16:26
94f8ac1
to
1e416fc
Compare
Spawning container processes is delegated to a separated 'forker' process. The runtime communicates with this process through a unix domain socket. With this change, northstar's runtime can now execute in multithreaded mode without the danger of the libc deadlocking issue. ┌───────────┐ ┌────────┐ ┌────────────────────────────┐ │ Northstar ├────┤ Forker │ │ Container A │ │ Runtime │ └────┬───┘ │ ┌──────┐ ┌───────────────┐ │ └───────────┘ ├───────┼►│ Init ├─┤ Application A │ │ │ │ └──────┘ └───────────────┘ │ │ └────────────────────────────┘ │ │ ┌────────────────────────────┐ │ │ Container B │ │ │ ┌──────┐ ┌───────────────┐ │ ├───────┼►│ Init ├─┤ Application B │ │ │ │ └──────┘ └───────────────┘ │ │ └────────────────────────────┘ ▼ ... The 'forker' process must consequently be single threaded. Additionally, Init processes handle requests to start new processes inside the container. This is a prerequisite to #454. Additional details ------------------ - Northstar version is bumped to 0.7.0-dev - Panic if the forker process exits unexpectedly If the forker process dies for whatever reason, it is not possible to recoverable and the runtime bails out. - Do not limit the number of threads of the runtime in demo main - Parallel loading of NPKs from disk The loading of NPKs from disk is slow and blocking. Spawn a thread for each NPK in order to speed up the boring parsing of the NPK headers. - Replace manifest IO Pipe with Log The 'pipe' option for the container output is removed from the manifest. The option 'log' is renamed to 'pipe'. A new option 'discard' is added for the output. - Refactor container IO handling When the container IO configuration in the manifest indicates that any of `stdout` or `stderr` is to be 'piped', a socket is used to receive the output from the container. On the other side, the runtime uses a `async` task to forward the incoming output from the socket to the runtime log. - Pipes are removed and replaced with sockets Co-authored-by: Felix Obenhuber <[email protected]> Co-authored-by: Alfonso Ros <[email protected]>
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.
Spawning container processes is delegated to a separated 'forker'
process. The runtime communicates with this process through a unix
domain socket.
With this change, northstar's runtime can execute in multithreaded mode
without the danger of the libc deadlocking issue. The 'forker' process
must consequently be single threaded.
Additionally, this patch introduces a small API for the container Init
processes that enables the request to start new processes inside the
container. This is a prerequisite to #454.
Additional details
Northstar version is bumped to
0.7.0-dev
(see Start using SemVer 'pre-releases' #496 )Panic if the forker process exits unexpectedly
If the forker process dies for whatever reason, it is not possible
to recoverable and the runtime bails out.
Do not limit the number of threads of the runtime in demo main
Parallel loading of NPKs from disk
The loading of NPKs from disk is slow and blocking. Spawn a thread
for each NPK in order to speed up the boring parsing of the NPK
headers.
Replace manifest IO Pipe with Log
The 'pipe' option for the container output is removed from the
manifest. The option 'log' is renamed to 'pipe'. A new option
'discard' is added for the output.
Refactor container IO handling
When the container IO configuration in the manifest indicates that
any of
stdout
orstderr
is to be 'piped', a socket is used toreceive the output from the container. On the other side, the
runtime uses a
async
task to forward the incoming output from thesocket to the runtime log.
Pipes removed and replaced with sockets