diff --git a/internal/executor/job_context/job_context.go b/internal/executor/job_context/job_context.go index 6becf67c2ed..b24ef688bea 100644 --- a/internal/executor/job_context/job_context.go +++ b/internal/executor/job_context/job_context.go @@ -46,7 +46,11 @@ func (c *ClusterJobContext) GetRunningJobs() ([]*RunningJob, error) { } func (c *ClusterJobContext) DeleteJobs(jobs []*RunningJob) { + c.activeJobIdsMutex.Lock() + defer c.activeJobIdsMutex.Unlock() + for _, job := range jobs { + delete(c.activeJobIds, job.JobId) c.clusterContext.DeletePods(job.Pods) } }