-
Notifications
You must be signed in to change notification settings - Fork 779
Ensure consistent preemptor state across queue heads and second pass #14815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
9f2b91c
e16da68
50309c7
231accc
338f571
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -919,30 +919,36 @@ func (m *Manager) Heads(ctx context.Context) []Head { | |
| } | ||
| } | ||
|
|
||
| // heads returns the heads of the queues and ready second-pass workloads. | ||
| func (m *Manager) heads() []Head { | ||
| heads := m.secondPassQueue.takeAllReady() | ||
| var heads []Head | ||
| for wInfo := range m.secondPassQueue.takeAllReady() { | ||
| cq := m.getClusterQueueLockless(wInfo.ClusterQueue) | ||
| if cq == nil { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One behavior difference worth considering here: on main, a ready second-pass workload whose ClusterQueue has disappeared is still returned by With this continue, This seems reachable if the CQ is deleted while the workload is waiting for its second pass, since
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great catch! You're right and I addressed the issue. |
||
| continue | ||
| } | ||
| isPreemptor := cq.IsPreemptor(&wInfo) | ||
| heads = append(heads, Head{ | ||
| Info: wInfo, | ||
| IsPreemptor: isPreemptor, | ||
| }) | ||
| } | ||
| for cqName, cq := range m.hm.ClusterQueues() { | ||
| // Cache might be nil in tests, if cache is nil, we'll skip the check. | ||
| if m.statusChecker != nil && !m.statusChecker.ClusterQueueActive(cqName) { | ||
| continue | ||
| } | ||
| wl := cq.Pop() | ||
| head := cq.PopHead() | ||
| reportCQPendingWorkloads(m, cq) | ||
| if wl == nil { | ||
| if head == nil { | ||
| continue | ||
| } | ||
| wlKey := workload.Key(wl.Obj) | ||
| wlCopy := *wl | ||
| wlCopy.ClusterQueue = cqName | ||
| heads = append(heads, Head{ | ||
| Info: wlCopy, | ||
| IsPreemptor: cq.IsPreemptor(wl), | ||
| }) | ||
|
|
||
| head.ClusterQueue = cqName | ||
| heads = append(heads, *head) | ||
| wlKey := workload.Key(head.Obj) | ||
| qKey := m.workloadAssignedQueues[wlKey] | ||
| q := m.localQueues[qKey] | ||
| delete(q.items, wlKey) | ||
|
|
||
| reportLQPendingWorkloads(m, q) | ||
| } | ||
| return heads | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.