From 4f909fd37e4094c94a642b9833ea3d14fcc984e8 Mon Sep 17 00:00:00 2001 From: Vincenzo Eduardo Padulano Date: Mon, 24 Jun 2024 09:38:13 +0200 Subject: [PATCH] Prevent slowdown in yum due to high file descriptor count Set the maximum number of file descriptors to 1024 before going through the `yum install` step of the build, only in case `yum_requirements.txt` is present in the recipe. This is done to mitigate a bug with old versions of rpm such as the one shipped with the Centos7 container. See https://bugzilla.redhat.com/show_bug.cgi?id=1537564 --- conda_smithy/templates/build_steps.sh.tmpl | 7 +++++- news/1958_yum_fix_ulimit.rst | 26 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 news/1958_yum_fix_ulimit.rst diff --git a/conda_smithy/templates/build_steps.sh.tmpl b/conda_smithy/templates/build_steps.sh.tmpl index 93fb76eef..46c83d8db 100644 --- a/conda_smithy/templates/build_steps.sh.tmpl +++ b/conda_smithy/templates/build_steps.sh.tmpl @@ -62,7 +62,12 @@ setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" {% if build_setup -%} {{ build_setup }}{% endif -%} {% if yum_build_setup is defined -%} -{{ yum_build_setup }}{% endif -%} +# Due to https://bugzilla.redhat.com/show_bug.cgi?id=1537564 old versions of rpm +# are drastically slowed down when the number of file descriptors is very high. +# This can be visible during a `yum install` step of a feedstock build. +ulimit -n 1024 +{{ yum_build_setup }} +{% endif -%} # make the build number clobber make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" diff --git a/news/1958_yum_fix_ulimit.rst b/news/1958_yum_fix_ulimit.rst new file mode 100644 index 000000000..edb556f2e --- /dev/null +++ b/news/1958_yum_fix_ulimit.rst @@ -0,0 +1,26 @@ +**Added:** + +* + +**Changed:** + +* Changed the build_steps.sh template so that it sets the number of maximum file + descriptors to 1024. This is done to mitigate a bug in old rpm versions (such + as the one shipped with the Centos7 container) that cause the yum install step + to take tremendously longer than necessary. See https://bugzilla.redhat.com/show_bug.cgi?id=1537564 + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*