From 83bb1e10981d374d48827110ffd7110105fb6852 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ma=C3=ABl=20Madon?= <mael.madon@irit.fr>
Date: Wed, 12 Jul 2023 08:34:28 +0200
Subject: [PATCH] fix: easy_bf_fast not updating properly the expected start
 time, see issue9 batsched

---
 src/scheds/easy_bf_fast.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/scheds/easy_bf_fast.cpp b/src/scheds/easy_bf_fast.cpp
index 03919cc..1a9112a 100644
--- a/src/scheds/easy_bf_fast.cpp
+++ b/src/scheds/easy_bf_fast.cpp
@@ -147,6 +147,11 @@ void EasyBackfillingFast::make_decisions(double date,
             // Backfill jobs that does not hinder priority job.
             if (_nb_available_machines > 0)
             {
+                // Update priority job expected starting time (might have changed if a recently ended job 
+                // completed before its walltime)
+                if (_priority_job != nullptr)
+                    _priority_job->completion_time = compute_priority_job_expected_earliest_starting_time();
+
                 for (auto job_it = _pending_jobs.begin();
                      job_it != _pending_jobs.end();)
                 {
-- 
GitLab