-
Notifications
You must be signed in to change notification settings - Fork 346
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
Get the result of exec command #1018
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
==========================================
- Coverage 69.41% 69.28% -0.14%
==========================================
Files 118 118
Lines 12446 12474 +28
==========================================
+ Hits 8640 8643 +3
- Misses 3806 3831 +25 |
Hey @utam0k , sorry I haven't been much active here recently 😅 Let me know if you need any help with this! |
0d1ae45
to
0f07edf
Compare
@YJDoc2 Thanks for your help. Can I ask you to help me with this pr? I am currently having trouble getting fifo's fd to pass to the init process, and I plan to get the results of exec's command execution through fifo. |
Hey, sure, I'll take a look and see if I can do anything by this weekend :) |
@utam0k should we make this ready for review and get review? |
e99b23d
to
76b85f6
Compare
Signed-off-by: utam0k <k0ma@utam0k.jp>
Signed-off-by: utam0k <k0ma@utam0k.jp>
Now the intermediate process waits for the main process only when exec is called, not when the container is created. This prevents it from waiting for created contianers, for which exec might not be called. This also fixes some formatting issues
76b85f6
to
4f2e27d
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.
Some nits and requests for comments. Otherwise, LGTM.
@@ -115,7 +118,13 @@ pub fn container_intermediate_process( | |||
.close() | |||
.context("failed to close unused init sender")?; | |||
|
|||
Ok(()) | |||
if wait { |
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.
Can we just return the pid here and then do the wait in container_main_process (line 36)? I would like to handle this as high up as possible and leave the lower layers untouched.
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.
Hey, @Furisto that was the original way I tried to do it, but the issue with it is that the final process (container process) is child of the intermediate process, so only that can wait for it. Trying to waitpid
on the final process from the main process fails, as it is not main process's child. Thus we need to make intermediate wait for the final process, and main process wait for intermediate
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.
I understand that. What I am asking is to do the wait here, that's in the main_process file, but the code in that location is executed by the intermediate process.
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.
Oh, ok, sorry I misunderstood earlier. Can you take a look at utam0k#116 and see if that is what you expected?
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.
@YJDoc2 Thanks, that is what I was thinking of
Make changes suggested in review
Move wait logic from intermediate process to main process
Hey, there's a clippy lint failing, I'll fix that after @Furisto has seen utam0k#116. That way if there are any other changes, I can make them as well. |
Fix clippy lint
Thanks!! @YJDoc2 |
@YJDoc2 Have you tried the integration test of containerd yet? |
@utam0k Unfortunately I haven't tried that yet, and am quite busy until this weekend, so probably will do it after that. Apologies for the delay. Also thanks a lot for helping with this PR! 😄 |
@YJDoc2 We passed 💯
|
hmm... but we got failed another test case
|
Fix: #953