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

Improve catching of reproc errors #1250

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

adriendelsalle
Copy link
Member

@adriendelsalle adriendelsalle commented Nov 3, 2021

Description

Improve catching of reproc errors:

  • catch reproc status indicating process termination due to REPROC_SIGKILL or REPROC_SIGTERM
  • use newly created assert_reproc_success function to check other pkgmgr calls
    • it catches REPROC_SIGKILL or REPROC_SIGTERM as errors if (and only if) respectively reproc::stop::kill or reproc::stop::terminate stop actions are not declared in as reproc::options

It will fix errors such as OOM-killed subprocess not caught (in Docker container or build for example).

See DaanDeMeyer/reproc#68
Closes #1100

@wolfv
Copy link
Member

wolfv commented Nov 3, 2021

cool!

I am just wondering if we need these two simple functions. I think I would prefer to just use the constants directly in the code.

@adriendelsalle
Copy link
Member Author

I'm improving the assert_reproc_success to take the reproc::options and determine given the options.stop actions if SIGKILL or SIGTERM has to be considered as an error or not.
I can remove the extra functions from the API.

libmamba/src/api/install.cpp Outdated Show resolved Hide resolved
catch reproc status indicating process killed or terminated
use newly created assert_reproc_success function to check other pkgmgr calls
throw an error only is no stop action could have killed or terminated the process
remove reproc_killed and reproc_terminated from API
link against reproc
@wolfv wolfv merged commit ca36829 into mamba-org:master Nov 3, 2021
@wolfv
Copy link
Member

wolfv commented Nov 3, 2021

Awesome!

@adriendelsalle adriendelsalle deleted the fix-reproc-oom branch November 3, 2021 15:33
@adriendelsalle adriendelsalle added this to the 2021.11.17 milestone Nov 17, 2021
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.

Insufficient memory leads to package install failure with micromamba, but docker build still succeeds
2 participants