From 92167df334cbb45b2f03c8ad08fb841993c810b7 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 11 Sep 2024 16:33:38 +0200 Subject: [PATCH] mxqd: Remove RLIMIT_CPU usage for runtime limitation The current code applies a RLIMIT_CPU limit to jobs with `job_threads == i`. This is incorrect, as such jobs can still get more processors if they require more server slots because of their memory demands. Since mxqd can now monitor and reliably kill jobs that exceed their allowed runtime, this code is obsolete and no longer useful. There is no reason to fix this code, so remove it entirely. --- mxqd.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/mxqd.c b/mxqd.c index 1a55545..3f572a8 100644 --- a/mxqd.c +++ b/mxqd.c @@ -1018,17 +1018,6 @@ static void exec_reaper(struct mxq_server *server,struct mxq_group_list *glist, mx_log_err("job=%s(%d):%lu:%lu setrlimit(RLIMIT_CORE, ...) failed: %m", group->user_name, group->user_uid, group->group_id, job->job_id); - /* set single threaded time limits */ - if (group->job_threads == 1) { - /* set cpu time limits - hardlimit is 105% of softlimit */ - rlim.rlim_cur = group->job_time*60; - rlim.rlim_cur = group->job_time*63; - - if (setrlimit(RLIMIT_CPU, &rlim) == -1) - mx_log_err("job=%s(%d):%lu:%lu setrlimit(RLIMIT_CPU, ...) failed: %m", - group->user_name, group->user_uid, group->group_id, job->job_id); - } - if (initgroups(passwd->pw_name, group->user_gid) == -1) { mx_log_err("job=%s(%d):%lu:%lu initgroups() failed: %m", group->user_name, group->user_uid, group->group_id, job->job_id);