-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix leaking FDs in the run (_call) function #880
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
To launch regression testing public members of oamg organization can leave the following comment:
Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra. |
/packit copr-build |
/packit copr-build |
tested and it's still broken with the same error for IPU 9 -> 10. Let's see whether we will be able to fix it before the release, otherwise let's keep it for the next release. Currently we have just ~4d for changes in this release and the issue is discovered only for IPU 9 -> 10. |
/packit copr-build |
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.
seems it works as expected now. tested manually (rhel7 & rhel9), the stdout/stderr FDs have been really leaking too. Let's wait for the test results yet.
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 and works as expected. double checked with @abadger that it should be safe enough even so close to the release. merging
Reverting commit 60f500e The original commit only workarounded the root cause - leaked file descriptors in the leapp stdlib when using the `run` function. Dropping the change in the actor as it is not needed anymore. relates: oamg/leapp#880
## Packaging - Start building for EL 9 in the upstream repository on COPR (oamg#855) ## Framework ### Enhancements - Minor update in the summary overview to highlight what is present in the pre-upgrade report (oamg#858) - Store metadata about actors, workflows, and dialogs inside leapp audit db (oamg#847, oamg#867) ## Leapp (tool) ### Enhancements - Implement singleton leapp execution to prevent multiple running leapp instances on the system in the same time (oamg#851) ## stdlib ### Fixes - Close properly all file descriptors when executing shell commands via `run` (oamg#880) ## Modifications - Code is now Python3.12 compatible (oamg#855)
## Packaging - Start building for EL 9 in the upstream repository on COPR (#855) ## Framework ### Enhancements - Minor update in the summary overview to highlight what is present in the pre-upgrade report (#858) - Store metadata about actors, workflows, and dialogs inside leapp audit db (#847, #867) ## Leapp (tool) ### Enhancements - Implement singleton leapp execution to prevent multiple running leapp instances on the system in the same time (#851) ## stdlib ### Fixes - Close properly all file descriptors when executing shell commands via `run` (#880) ## Modifications - Code is now Python3.12 compatible (#855)
Reverting commit 60f500e The original commit only workarounded the root cause - leaked file descriptors in the leapp stdlib when using the `run` function. Dropping the change in the actor as it is not needed anymore. relates: oamg/leapp#880 (cherry picked from commit 24700ee)
Reverting commit 60f500e The original commit only workarounded the root cause - leaked file descriptors in the leapp stdlib when using the `run` function. Dropping the change in the actor as it is not needed anymore. relates: oamg/leapp#880 (cherry picked from commit 24700ee)
updated by @pirat89
Original implementation of the
_call
function (used byrun
from actors) has been leaking file descriptors per each invocation. So in case an actor executed too many of them during an execution it could reach the limit of allowed opened FDs and the execution failed withOSError: Too many opened files
error.There have been actually 2 issues:
EventLoop
(aliasselect.epoll
) have been called before the fork so the child process inherit the created FD toostdout
andstderr
pipes (to consumes content from child process) have been created before the fork but have not been closed in the parentEventLoop
is closed (and death of the child process) resolved this issue.Warning: totally untested (@pirat89 manually tested on rhel7 & rhel9)