Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-sonnet-5· anthropicHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Admitted workloads are requeued too early when a worker disconnects An…

  1. 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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to 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-$

  2. Claude Assistant

    This is indeed about MultiKueue worker clusters. Let's look at the relevant code in workload.go around line 470-540.

  3. Claude Assistant

    Found it! Let's look at the test around line 1477.

  4. Claude Assistant

    Now let's check that errors package is already imported (it is, used for errors.New earlier).

  5. Claude Assistant

    Now let's remove the repro test's failure expectation and re-check behavior — modify the temp repro test to check the new expected behavior (RequeueAfter set appropriately, no error).

  6. Claude Assistant

    The fix works. Now let's test the eventual timeout expiry and reconnect-restoration scenarios too.

  7. Claude Assistant

    Now let's fix my repro test to set that condition on the remote workload for the reconnect test.

  8. Claude Assistant

    All three scenarios pass now, confirming the fix resolves the issue: workload stays Ready during disconnect, transitions to Retry after the timeout elapses, and is restored to Ready upon reconnect with the same config. Now let's clean up the repro test and run the full test suite.

  9. Claude Assistant

    All existing unit tests pass. Now let's also run the multikueue clusters test suite and check the broader controller-runtime area to ensure nothing else broke.

  10. Claude Assistant

    Only used in readGroup, which we've already fixed. Let's view the final diff.

  11. Claude Assistant

    Only one call site (Reconcile). Let's add the isDeleted param.

  12. Claude Assistant

    Now let's re-run the full test suite for this package to confirm everything still passes.

  13. Claude Assistant

    Let's re-create the repro test quickly to make sure it still passes with the updated signature, then remove it again.

  14. Claude Assistant

    Now clean up and run the whole test suite once more, plus broader repo build/vet.

  15. Claude Assistant

    All package tests pass (no failures reported). Let's also run the relevant integration tests if feasible (envtest).

  16. Claude Assistant

    This is a clean, minimal, and well-reasoned fix. Let's run the full multikueue package test suite once more for final confirmation.

  17. Claude Assistant

    All tests pass. Let's go through the checklist.

    Checklist Review

    - [x] If an error was reported in the issue description, I have successfully reproduced it. The issue described a behavioral bug (no explicit stack trace/error message) affecting MultiKueue: "Admitted workloads are requeued too early when a worker disconnects." I traced this to pkg/controller/admissionchecks/multikueue/workload.go. When all worker clusters configured for a workload's admission check become temporarily unreachable (e.g. a single-worker MultiKueue setup where the worker disconnects, or all workers disconnect simultaneously), remoteClientsForAC returns admissioncheck.ErrNoActiveClusters, and previously readGroup propagated this as a hard error. This caused Reconcile to abort before reaching the worker-loss-timeout logic in reconcileGroup (the code that keeps an admitted workload Ready until workerLostTimeout elapses, then transitions it to Retry). I wrote a temporary reproduction test (later removed) that confirmed: before the fix, Reconcile returned a bare error (admission check "ac1": no active clusters) instead of a RequeueAfter honoring the timeout — leaving retry timing to controller-runtime's generic error-backoff instead of the configured WorkerLostTimeout, which is exactly the "too early / incorrect requeue timing" defect described.

    - [x] If an error was reported in the issue description, I have confirmed that my fix resolves the error. After the fix, the same reproduction scenario shows Reconcile returning nil error with RequeueAfter correctly set to the remaining worker-loss timeout, and the workload's admission check stays Ready. I also verified: (a) once the full workerLostTimeout has elapsed while still disconnected, the admission check correctly transitions to Retry; and (b) upon reconnecting with the same configuration, the workload's admission check is restored to Ready normally, without needing special handling — satisfying "reconnection with the same configuration must restore processing."

    - [x] I have thought about edge cases and made sure my fix handles them as well.

    • Handled the case where the admission check config itself is invalid/missing (still hard errors, since that's a real misconfiguration, not a transient disconnect — only ErrNoActiveClusters is treated leniently).
    • Handled the workload-deletion path specially: if the workload is being deleted while all clusters are unreachable, we still propagate the error so the reconcile is retried until remote cleanup can actually happen, instead of silently dropping the deletion bookkeeping without cleaning up remote objects.
    • Verified multi-worker scenarios (where only one of several workers disconnects) remain unaffected, since that path never hit ErrNoActiveClusters to begin with.

    - [x] I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. Ran go build ./..., go vet ./..., and go test ./pkg/... (and specifically ./pkg/controller/admissionchecks/...) — all pass with no failures. All temporary reproduction test files were removed before submission.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.