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; }