diff --git a/src/scontrol/update_job.c b/src/scontrol/update_job.c index 41f1635195011daece8c914b180838e228b3e64e..7d4411bd23d3e1fb8b9a61c6b9305d330d350588 100644 --- a/src/scontrol/update_job.c +++ b/src/scontrol/update_job.c @@ -625,8 +625,8 @@ scontrol_update_job (int argc, char *argv[]) } else if (!strncasecmp(tag, "EligibleTime", MAX(taglen, 2)) || !strncasecmp(tag, "StartTime", MAX(taglen, 2))) { - if((job_msg.begin_time = parse_time(val, 0))) { - if(job_msg.begin_time < time(NULL)) + if ((job_msg.begin_time = parse_time(val, 0))) { + if (job_msg.begin_time < time(NULL)) job_msg.begin_time = time(NULL); update_cnt++; } diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 64711d1e658b93c92eaf7af9f167570b1f54e519..005596d122c060220b9680fb04cd39570f63533b 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -7292,12 +7292,11 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) if (job_specs->begin_time) { if (IS_JOB_PENDING(job_ptr) && detail_ptr) { - /* Make sure this time is current, it does no - good for accounting to say this job could had - started in the past since the job isn't - going to start until now as the earliest. - */ - if(job_specs->begin_time < now) + char time_str[32]; + /* Make sure this time is current, it does no good for + * accounting to say this job could have started before + * now */ + if (job_specs->begin_time < now) job_specs->begin_time = now; detail_ptr->begin_time = job_specs->begin_time; @@ -7305,6 +7304,11 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) if ((job_ptr->priority == 1) && (detail_ptr->begin_time <= now)) _set_job_prio(job_ptr); + slurm_make_time_str(&detail_ptr->begin_time, time_str, + sizeof(time_str)); + info("sched: update_job: setting begin to %s for " + "job_id %u", + time_str, job_ptr->job_id); } else { error_code = ESLURM_DISABLED; goto fini;