in pkg/queue/manager.go [284:313]
func (m *Manager) RequeueWorkload(ctx context.Context, info *workload.Info, reason RequeueReason) bool {
m.Lock()
defer m.Unlock()
var w kueue.Workload
// Always get the newest workload to avoid requeuing the out-of-date obj.
err := m.client.Get(ctx, client.ObjectKeyFromObject(info.Obj), &w)
// Since the client is cached, the only possible error is NotFound
if apierrors.IsNotFound(err) || workload.IsAdmitted(&w) {
return false
}
q := m.localQueues[workload.QueueKey(&w)]
if q == nil {
return false
}
info.Update(&w)
q.AddOrUpdate(info)
cq := m.clusterQueues[q.ClusterQueue]
if cq == nil {
return false
}
added := cq.RequeueIfNotPresent(info, reason)
m.reportPendingWorkloads(q.ClusterQueue, cq)
if added {
m.Broadcast()
}
return added
}