diff --git a/scheduler/util.go b/scheduler/util.go index e910f3db1..6a851ae36 100644 --- a/scheduler/util.go +++ b/scheduler/util.go @@ -84,6 +84,11 @@ func diffAllocs(job *structs.Job, taintedNodes map[string]bool, // If we are on a tainted node, we must migrate if we are a service or // if the batch allocation did not finish if taintedNodes[exist.NodeID] { + // If the job is batch and finished succesfully, the fact that the + // node is tainted does not mean it should be migrated as the work + // was already succesfully finished. However for service/system + // jobs, tasks should never complete. The check of batch type, + // defends against client bugs. if exist.Job.Type == structs.JobTypeBatch && exist.RanSuccessfully() { goto IGNORE }