Skip to content

Commit

Permalink
Avoid sporadic "No matching job found" warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Aug 24, 2021
1 parent caa8dce commit 40258b9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 40258b9

Please sign in to comment.