Skip to content

Commit

Permalink
Log build job queue timeout less ofter
Browse files Browse the repository at this point in the history
Rather than generating loads of log messages about too much time
being used to build the job queue every few seconds, log it only
every 10 minutes.
bug 1827
  • Loading branch information
jette committed Jul 27, 2015
1 parent 4f40d60 commit aee694e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/slurmctld/job_scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ static int _delta_tv(struct timeval *tv)
*/
extern List build_job_queue(bool clear_start, bool backfill)
{
static time_t last_log_time = 0;
List job_queue;
ListIterator job_iterator, part_iterator;
struct job_record *job_ptr = NULL;
Expand All @@ -308,10 +309,15 @@ extern List build_job_queue(bool clear_start, bool backfill)
while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
if (((tested_jobs % 100) == 0) &&
(_delta_tv(&start_tv) >= build_queue_timeout)) {
info("build_job_queue has been running for %d usec, "
"exiting with %d of %d jobs tested, %d job-partition pairs added",
build_queue_timeout, tested_jobs,
list_count(job_list), job_part_pairs);
time_t now = time(NULL);
if (difftime(now, last_log_time) > 600) {
/* Log at most once every 10 minutes */
info(
"%s has run for %d usec, exiting with %d of %d jobs tested, %d job-partition pairs added",
__func__, build_queue_timeout, tested_jobs,
list_count(job_list), job_part_pairs);
last_log_time = now;
}
break;
}
tested_jobs++;
Expand Down

0 comments on commit aee694e

Please sign in to comment.