ISSUE DESCRIPTION Admitted workloads are requeued too early when a worker disconnects An…
- User
ISSUE DESCRIPTION
Admitted workloads are requeued too early when a worker disconnects
An admitted workload must remain ready during a temporary worker disconnect and be retried only after the configured worker-loss timeout. Reconnection with the same configuration must restore processing without affecting other connected workers.
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /kueue, current file: none) bash-$
- Assistant
I'll start by exploring the repository structure and searching for code related to worker disconnect and workload requeue behavior.
- Assistant
I'll search the codebase for MultiKueue worker disconnect and requeue timeout handling.
- Assistant
rg is not available, let me use grep.
- Assistant
Let me look at the multikueue workload.go and related code for worker disconnect handling.
- Assistant
Let me look at the workload.go file more carefully regarding workerLostTimeout and requeuing.
- Assistant
I'll open the relevant sections of workload.go around the worker-loss timeout handling.
- Assistant
The timeout is measured from ACS LastTransitionTime (when Ready), which is likely wrong — I'll examine tests and git history for more context.
- Assistant
I'll check cluster disconnection and how workloads are requeued on worker loss.
- Assistant
Let me look at setConfig and how reconnecting state works, and remoteClientsForAC
- Assistant
I'll check how ErrNoActiveClusters is handled in reconciliation.
- Assistant
When ErrNoActiveClusters is returned from readGroup, Reconcile just returns the error which causes a retry by controller-runtime. That might flood with errors but wouldn't requeue the ACS.
- Assistant
Looking at
syncReservingRemoteStateto determine when ACS LastTransitionTime is updated after becoming Ready. - Assistant
Interesting —
needsACUpdatealways refreshes LTT while Ready. Let me dig into setConfig and what happens to the remote client on disconnect. - Assistant
Checking the changelog and KEPs for worker-lost behavior notes.
- Assistant
Looking at needsACUpdate again:
- Assistant
I think I found it: SetAdmissionCheckState only updates LastTransitionTime when the state changes, so the heartbeat never refreshes. Checking the history next.
- Assistant
LTT isn't refreshed while Ready; next I'll check whether the admission-status patch skips no-ops and Scan the related tests.
- Assistant
Looking at who calls SetAdmissionCheckState and how LTT is handled.
- Assistant
The LTT refresh bug looks solid. Checking other disconnect/reconnect path issues next.
- Assistant
Confirming the clock type and how other code refreshes LTT for similar purposes.
- Assistant
I'll check SetAdmissionCheckState tests to determine whether we should change lasting LTT update behavior.
- Assistant
Let me look at SetAdmissionCheckState tests carefully around line 418.
- Assistant
The root cause is that
SetAdmissionCheckStateonly refreshes LTT on state changes, so MultiKueue's worker-loss heartbeat never lands. I'll force-update LTT insyncReservingRemoteStateand use the injected clock for the timeout. - Assistant
I'll navigate to the right lines and apply the edit.
- Assistant
Let me use edit command.
- Assistant
Now fix syncReservingRemoteState to force update LTT.
- Assistant
I'll force LTT update after SetAdmissionCheckState.
- Assistant
There's another path when all workers are connecting: reconciliation fails before the timeout path runs. Checking that next.
- Assistant
I'll check how Ready-state tests assert LTT after a successful sync.
- Assistant
Running multikueue unit tests to verify the fix.
- Assistant
Need to set GOCACHE or HOME
- Assistant
I'll check whether inactive MultiKueueClusters cause premature workload requeues.
- Assistant
I'll inspect how PatchAdmissionStatus applies updates to the in-memory workload.
- Assistant
There's also PrepareWorkloadPatch which might strip LTT. Let me check.
- Assistant
Verifying the full diff and whether needsACUpdate should avoid unnecessary patches.
- Assistant
I'll add a quick temporary test to prove the LTT heartbeat behaves correctly.
- Assistant
Confirmed the bug and the fix. Cleaning up and re-running the multikueue unit tests.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.