-
Notifications
You must be signed in to change notification settings - Fork 97
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
Build libcontainer's container on Instance::new to be spec compliant #340
Conversation
@squillace FYI |
9c83cd2
to
76c3bd8
Compare
this is the side affect of this change?
Would it be something like:
|
No, this is what I observe on linux before this change. With this change I do not observe any dangling process and no hanging. |
Yes, that's 100% correct, thanks!. I'll add test points for all shims. |
I gave the test a go. The right place for it would be in the However, that test uses the A solution is moving the testing utility from |
I recommend reviewing the commits separately :-) |
98e17bc
to
4f94d6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great find! Creating the container during the new aligns with containerd's "task_create" which makes sense. left a few minor comments
crossbeam = { workspace = true } | ||
env_logger = { workspace = true, optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since these are under dev-dependencies are they needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consumers of the testing
feature of the library we need to specify it as a normal dependencies
as well.
All 3 dev-dependencies
are also specified as optional normal dependencies
that get enabled by the testing
feature.
I'm open to suggestions 😄
ea8fc1f
to
3b03ecd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -746,10 +746,10 @@ impl<T: Instance + Send + Sync> Local<T> { | |||
); | |||
InstanceData { | |||
instance: None, | |||
base: Some(Nop::new(id, None)), | |||
base: Some(Nop::new(id, None).unwrap()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is safe since Nop::new()
always returns Ok
. might be work a comment incase things change in future?
@jprendes this needs a rebase, but lgtm after that. |
3b03ecd
to
ab6eaaa
Compare
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
ab6eaaa
to
acc190a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Fixes #158 and #326
The issue behind #326 is that we are asking youki to create and start the container on the start call.
We don't do any meaningful work on the create call.
This missmach means that containerd is assuming that extra setup has happened successfully. but youki hasn't done it yet. When youki fails to do it at start, we are breaking those assumptions (e.g., being able to provide a PID for the init process).
The solution is to
build
(create) the youki container on the create call (i.e., thenew
method of runwasi's instance).This also requires that we change the signature of
new
to return aResult<Self, Error>
, which was previously mentioned in #158.I haven't added any test for this here as testing it is rather involved.Thanks @jsturtevant for suggesting testing approach.The sideeffect of this issue on the first invocation is that we leave a dangling process, and on a second invocation is a hang.
I'm open to suggestions on how we could test it.