From d897a2a17601934c980914dd3cb3148e53bff96d Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 5 Sep 2016 13:30:37 +0200 Subject: [PATCH] mxqd_control: account orphaned groups The count of running jobs and threads of a group were not deducted from the counters the server keeps for the user and the cluster. This lead to wrong scheduling, as users were thought to have more running jobs than they really had. Add code to maintain the global counters. --- mxqd_control.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mxqd_control.c b/mxqd_control.c index c0cba694..419d6bfb 100644 --- a/mxqd_control.c +++ b/mxqd_control.c @@ -489,7 +489,11 @@ int server_remove_orphaned_groups(struct mxq_server *server) group->group_id); ulist->group_cnt--; + ulist->global_slots_running -= glist->global_slots_running; + ulist->global_threads_running -= glist->global_threads_running; server->group_cnt--; + server->global_slots_running -= glist->global_slots_running; + server->global_threads_running -= glist->global_threads_running; cnt++; mxq_group_free_content(group); mx_free_null(glist);