From 40258b95b206862f06c4de9157988827fa2ce639 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 22 Aug 2021 16:59:40 +0200 Subject: [PATCH] Avoid sporadic "No matching job found" warning We currently get a "No matching job found - maybe another server was a bit faster. ;)" warning when we just started the last job of a group. The reason is that the INQ count going to zero is tracked in the database by the sql triggers but is not yet updated in the in-memory copy. Decrement group_jobs_inq after we loaded a job. --- mxqd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mxqd.c b/mxqd.c index 71a7472d..940bf306 100644 --- a/mxqd.c +++ b/mxqd.c @@ -1407,6 +1407,17 @@ unsigned long start_job(struct mxq_group_list *glist) mx_log_info(" job=%s(%d):%lu:%lu :: started. pid=%d", group->user_name, group->user_uid, group->group_id, job->job_id, pid); + /* The group counts in the database were updated by the sql triggers when + * we set the job from ASSIGNED to LOADED. We would pick that up in the + * next round of the main loop. Update the in-memory counts right now so + * that we don't try to start a new job when there are no INQ jobs left. + * This avoids a "No matching job found - maybe another server was a bit + * faster" warning when we started the last INQ jobs from a group. + */ + + group->group_jobs_inq--; + group->group_jobs_running++; + return 1; }