From 66042e1484b0481f235f57962138e592eb0f073c Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 22 Feb 2011 23:21:27 +0000
Subject: [PATCH] Avoid setting a job's eligible time while held (priority ==
 0).

---
 NEWS                    | 1 +
 src/slurmctld/job_mgr.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 46018339bbe..1deb962f654 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ documents those changes that are of interest to users and admins.
     option. Patches from Rod Schulz, Bull.
  -- Applied patch from Martin Perry to fix "Incorrect results for task/affinity
     block second distribution and cpus-per-task > 1" bug.
+ -- Avoid setting a job's eligible time while held (priority == 0). 
 
 * Changes in SLURM 2.2.2
 ========================
diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index 94aedb947a8..a5f01da98d0 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -7787,7 +7787,8 @@ extern bool job_independent(struct job_record *job_ptr, int will_run)
 		job_ptr->state_reason = WAIT_NO_REASON;
 		xfree(job_ptr->state_desc);
 	}
-	if (detail_ptr && (detail_ptr->begin_time == 0)) {
+	if ((detail_ptr && (detail_ptr->begin_time == 0) &&
+	    (job_ptr->priority != 0))) {
 		detail_ptr->begin_time = now;
 	} else if (job_ptr->state_reason == WAIT_TIME) {
 		job_ptr->state_reason = WAIT_NO_REASON;
-- 
GitLab