Skip to content
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

Address ECHILD #1777

Merged
merged 2 commits into from
Apr 6, 2023
Merged

Address ECHILD #1777

merged 2 commits into from
Apr 6, 2023

Conversation

utam0k
Copy link
Member

@utam0k utam0k commented Apr 5, 2023

Assume the case where intermediate_process is waitpid by someone and ignore ECHILD in that case.
This is safe. This is safe because intermediate_process and main_process check if the process is finished by piping instead of exit code.

Copy link
Contributor

@rumpl rumpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2023

Codecov Report

Merging #1777 (df5fa86) into main (3827658) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1777      +/-   ##
==========================================
- Coverage   68.67%   68.64%   -0.04%     
==========================================
  Files         121      121              
  Lines       13318    13324       +6     
==========================================
  Hits         9146     9146              
- Misses       4172     4178       +6     

Signed-off-by: utam0k <[email protected]>
Copy link
Contributor

@ipuustin ipuustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The only thing we need to check is that there won't be a race (where libcontainer succeeds in reaping the process before the other waitpid user does it). But that's not really youki's concern.

Copy link
Collaborator

@yihuaf yihuaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

_ => (),
Ok(_) => (),
Err(err) => {
if err == Errno::ECHILD {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can this be turned into Err(Errno::ECHILD) case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to do it because waitpid returns Result<T, Errno>
https://docs.rs/nix/latest/nix/type.Result.html

@utam0k utam0k merged commit 03eb78d into youki-dev:main Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants