From: Michael Tremer Date: Sat, 14 Dec 2024 16:18:38 +0000 (+0000) Subject: build: Ignore if cgroup limits could not be applied X-Git-Tag: 0.9.30~699 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7060305b05c65284ba629c9320746580e269d220;p=pakfire.git build: Ignore if cgroup limits could not be applied This should ideally not happen in a real environment, but sadly is a restriction we have in Jenkins when we are running the tests. Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/build.c b/src/libpakfire/build.c index 2df93a737..2eb3050cb 100644 --- a/src/libpakfire/build.c +++ b/src/libpakfire/build.c @@ -1378,16 +1378,32 @@ static int pakfire_build_setup_cgroup(struct pakfire_build* build) { "memory_guaranteed", PAKFIRE_BUILD_MEMORY_GUARANTEED); if (memory_guaranteed) { r = pakfire_cgroup_set_guaranteed_memory(build->cgroup, memory_guaranteed); - if (r) - goto ERROR; + if (r < 0) { + switch (-r) { + case ENOTSUP: + ERROR(build->ctx, "Could not apply the memory guarantee. Ignoring.\n"); + break; + + default: + goto ERROR; + } + } } // Limit memory size_t memory_limit = pakfire_config_get_bytes(config, "build", "memory_limit", 0); if (memory_limit) { r = pakfire_cgroup_set_memory_limit(build->cgroup, memory_limit); - if (r) - goto ERROR; + if (r < 0) { + switch (-r) { + case ENOTSUP: + ERROR(build->ctx, "Could not apply the memory limit. Ignoring.\n"); + break; + + default: + goto ERROR; + } + } } // Set PID limit @@ -1395,8 +1411,16 @@ static int pakfire_build_setup_cgroup(struct pakfire_build* build) { "pid_limit", PAKFIRE_BUILD_PID_LIMIT); if (pid_limit) { r = pakfire_cgroup_set_pid_limit(build->cgroup, pid_limit); - if (r) - goto ERROR; + if (r < 0) { + switch (-r) { + case ENOTSUP: + ERROR(build->ctx, "Could not apply the PID limit. Ignoring.\n"); + break; + + default: + goto ERROR; + } + } } ERROR: