From 43f0091ee332919000e41b60945dfdd6d2479ecd Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Wed, 11 Jun 2014 16:45:48 -0700
Subject: [PATCH] sched/backfill: Add more logging

---
 src/plugins/sched/backfill/backfill.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c
index 25fa1fb9a9d..a9cb752e723 100644
--- a/src/plugins/sched/backfill/backfill.c
+++ b/src/plugins/sched/backfill/backfill.c
@@ -710,7 +710,13 @@ static int _attempt_backfill(void)
 		njobs = xmalloc(BF_MAX_USERS * sizeof(uint16_t));
 	}
 	sort_job_queue(job_queue);
-	while ((job_queue_rec = (job_queue_rec_t *) list_pop(job_queue))) {
+	while (1) {
+		job_queue_rec = (job_queue_rec_t *) list_pop(job_queue);
+		if (!job_queue_rec) {
+			if (debug_flags & DEBUG_FLAG_BACKFILL)
+				info("backfill: reached end of job queue");
+			break;
+		}
 		if (slurmctld_config.shutdown_time)
 			break;
 		if (((defer_rpc_cnt > 0) &&
-- 
GitLab