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 for worker-loss timeout and disconnect handling in the MultiKueue code.
- Assistant
rg is not available, let me use grep.
- Assistant
Looking at the worker disconnect and requeue logic next.
- Assistant
Let me look at the workload.go file around the workerLostTimeout handling and also recent git history related to this issue.
- Assistant
I'll read more of the reconcile and remote-client selection paths.
- Assistant
I'll inspect the worker-loss unit tests and recent multikueue changes.
- Assistant
That hung-remote-watch fix looks related — I'll inspect it and the cluster reconnect path.
- Assistant
Checking integration tests about worker loss and the reconnect backoff logic.
- Assistant
Let me look carefully at the integration test and also AGENTS.md or any issue notes. Also look at git diff/status to see if there are any already applied changes.
- Assistant
Looking at the integration test more carefully - interestingly the test name says "Should requeue the workload with a delay when the connection to the admitting worker is lost" but looking at the test...I understand the issue you're describing. The test is indeed incorrectly written—it expects the workload to immediately go to Pending without waiting for the worker-loss timeout, which contradicts the expected behavior.
Let me think about this systematically:
- Assistant
Confirmed: timeout is measured from Ready transition, not disconnect. Checking how ACS updates and clock usage work.
- Assistant
Let me read SetAdmissionCheckState fully and syncReservingRemoteState
- Assistant
Checking SetAdmissionCheckState behavior and intended LastTransitionTime refresh on successful sync.
- Assistant
Noting another potential issue: remainingWaitTime uses
time.Sinceinstead of the reconciler clock. Checking that path and related history. - Assistant
Let me see git blame more on SetAdmissionCheckState and when LTT became conditional on state change. Also look at the original Keep ready timeout code.
- Assistant
So SetAdmissionCheckState has always only updated LTT when state changes. But Multikueue code tries to update LTT on every successful sync. That's a buggy interaction from the original PR.
- Assistant
Let me get the specific part about keep ready timeout from the original PR.
- Assistant
SSA used to rewrite LTT on every sync; checking when that switched to PatchAdmissionStatus.
- Assistant
Let me look at when they changed from SSA to jsonpatch for multikueue sync.
- Assistant
Inspecting PatchAdmissionStatus and verifying how acel mutations are applied.
- Assistant
Looking at how a disconnected worker is treated in remoteClients and word group reading.
- Assistant
Let me read the readGroup and foreach how remotes are populated when client is connecting.
- Assistant
Checking when
connectingis set and cleared on the remote client. - Assistant
The issue may also involve reconnect handling — reviewing that path next.
- Assistant
Searching for related TODOs and recent workload loss timeout changes.
- Assistant
Checking KeepAdmissionCheckPending and full syncReservingRemoteState again.
- Assistant
Checking PrepareWorkloadPatch and whether MergePatch is enabled by default.
- Assistant
There's also admissionChecksStatusPatch - let me look at that!
- Assistant
Identified the bug:
SetAdmissionCheckStateignores an explicitLastTransitionTimewhen state is unchanged, so MultiKueue can't refresh the heartbeat used for worker-loss detection. Implementing the fix. - Assistant
Updating
SetAdmissionCheckStateso an explicitLastTransitionTimeis honored even without a state change, and switching the lost-worker wait calculation onto the reconciler clock. - Assistant
Updating the worker-loss remaining-time calculation to use the reconciler clock.
- Assistant
Removing the extra brace introduced by the edit.
- Assistant
Removing the duplicate comment.
- Assistant
Removing the duplicate variable declaration.
- Assistant
Rewriting the whole section from git to clean up the duplicates.
- Assistant
I'll replace the broken section with the correct content.
- Assistant
Running the relevant unit tests to verify the fix.
- Assistant
Need to set GOCACHE
- Assistant
I'll write a temporary script to verify heartbeat LTT refresh and delayed requeue on disconnect.
- Assistant
Verifying the full diff looks correct.
- Assistant
Cleaning up the temp file and running final related tests.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.