Skip to content
TheChatArchiveThe Chat Archive
MiniMaxminimax/minimax-m3· unknownHugging 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. MiniMax Assistant

    .I'll start by exploring the repository to understand the codebase and the issue. The issue is about admitted workloads being requeued too early when a worker disconnects. Let's first examine the repository structure.

  3. MiniMax Assistant

    Let me see more of the multikueuecluster.go file to understand the disconnect logic:

  4. MiniMax Assistant

    Now let me look at the admissioncheck.go file in the same directory:

  5. MiniMax Assistant

    Let me now look at the workload.go and the clusterqueue.go files:

  6. MiniMax Assistant

    Now let me see the middle section of the workload.go that has the reconcileGroup logic:

  7. MiniMax Assistant

    Let me look at the dispatcher / events batch period. Let me search for workerLostTimeout:

  8. MiniMax Assistant

    Now I need to look at the test file to understand the issue and find where things need to be fixed:

  9. MiniMax Assistant

    Let me look at the test case for "worker reconnects after the local workload is requeued":

  10. MiniMax Assistant

    Let me look at the actual code path more carefully to understand the issue:

  11. MiniMax Assistant

    Now let me look at the admissioncheck.go to find ErrNoActiveClusters:

  12. MiniMax Assistant

    Let me also look at what the existing tests are for the reconnecting scenario:

  13. MiniMax Assistant

    Let me check where the clustersReconciler.lock is used:

  14. MiniMax Assistant

    Let me look at the existing test "reconnecting clients are skipped" carefully:

  15. MiniMax Assistant

    Let me check the integration tests for multikueue:

  16. MiniMax Assistant

    Let me now write a script to reproduce the issue and understand the test better:

  17. MiniMax Assistant

    Now I have a clear understanding. Let me write a small reproducer test first to verify the issue:

  18. MiniMax Assistant

    The test reproduces the bug. The error is no active clusters and the result is empty. Let me check what default backoff controller-runtime uses:

  19. MiniMax Assistant

    Let me also check the Requeue (not RequeueAfter) value returned by default. So the default is to requeue after a very short time. Now let me make the fix:

  20. MiniMax Assistant

    Now let me apply the fix. The fix should be in the Reconcile function to handle the case when there are no active clusters (workers all reconnecting) and the AC state is Ready:

  21. MiniMax Assistant

    Now let me apply the fix:

  22. MiniMax Assistant

    Good, errors is already imported. Now let me make the fix:

  23. MiniMax Assistant

    Now let me run the reproduction test to see if it passes:

  24. MiniMax Assistant

    Let me run the existing tests in the multikueue directory to make sure I didn't break anything:

  25. MiniMax Assistant

    All existing tests pass. Now let me think about edge cases and also add a test for the new behavior. First, let me look at the test cases that already exist:

  26. MiniMax Assistant

    Let me look at how the tests handle the wantRequeueAfter:

  27. MiniMax Assistant

    Let me also check what happens if mkAc.LastTransitionTime is nil:

  28. MiniMax Assistant

    Let me now check if there is a similar test for the issue. Let me look at the existing integration test:

  29. MiniMax Assistant

    Let me run the full tests for the package to make sure everything is still working:

  30. MiniMax Assistant

    All tests pass. Now let me also run the full pkg test to make sure my changes don't break anything else:

  31. MiniMax Assistant

    Now let me create a temporary test to verify edge cases:

  32. MiniMax Assistant

    All edge cases pass. Let me clean up the temporary test file:

  33. MiniMax Assistant

    Now let me think about other places where this issue could occur. Let me check the reconcileGroup function more carefully:

  34. MiniMax Assistant

    Now let me also check if there's a related issue with the nominateAndSynchronizeWorkers function:

  35. MiniMax Assistant

    Let me also look at how the multikueue cluster reconnect logic works:

  36. MiniMax Assistant

    Let me also check the Reconcile flow in the cluster reconciler:

  37. MiniMax Assistant

    Let me check how the admission check status affects the workload:

  38. MiniMax Assistant

    Let me check if there are any other tests that I should consider:

  39. MiniMax Assistant

    Now let me verify the fix handles the case where the AC is in Pending state with a single worker:

  40. MiniMax Assistant

    Let me clean up and look at the final code:

  41. MiniMax Assistant

    Now let me also think about the scenario where the workload is Retry state:

  42. MiniMax Assistant

    The fix is working correctly. Let me clean up the temporary test:

  43. MiniMax Assistant

    Let me also run all the tests in the package to make sure I didn't break anything:

  44. MiniMax Assistant

    All tests pass. Now let me think about other potential issues. Let me look at the findOrCreateRemoteClient and setRemoteClientConfig flow more carefully to see if there are any other places where the worker reconnecting could affect the workload:

  45. MiniMax Assistant

    Let me also run all the tests in the package to make sure:

  46. MiniMax Assistant

    All tests pass. Let me also check the multikueue cluster tests:

  47. MiniMax Assistant

    No failures. Let me also run the broader tests:

  48. MiniMax Assistant

    All tests pass. Now let me look at the final fix:

  49. MiniMax Assistant

    The diff looks clean. Now let me also check the git status to make sure there are no other changes:

  50. MiniMax Assistant

    Only one file is modified. Now let me think about other related places that might need fixing. Let me look at the issue more carefully:

  51. MiniMax Assistant

    Let me also do one more check on the fix to make sure it handles all the edge cases:

  52. MiniMax Assistant

    The fix works correctly even when the AC just became Ready. Let me clean up:

  53. MiniMax Assistant

    Now let me think about whether I need to consider the setRemoteClientConfig flow. Let me re-examine the multikueue cluster reconciler to see if there's anything else that could be relevant:

  54. MiniMax Assistant

    Let me also check if there's a test related to this in the issue:

  55. MiniMax Assistant

    Let me also run a comprehensive test:

  56. MiniMax Assistant

    All tests pass. Let me look at the final diff once more:

  57. MiniMax Assistant

    The fix is minimal and focused. Let me write a final reproduction script to verify the fix:

  58. MiniMax Assistant

    Let me check the formatting one more time:

  59. MiniMax Assistant

    The code is properly formatted. Let me run the unit tests one final time to make sure everything passes:

  60. MiniMax Assistant

    All tests pass. Let me now write a summary of the fix and submit it:

    Summary of the fix:

    The issue was that when all worker clusters are temporarily disconnected (reconnecting) and the local admission check is still in Ready state, the workload reconciler was returning the ErrNoActiveClusters error from readGroup. This caused the controller-runtime to requeue the workload with the default exponential backoff (starting at 5ms), which is much sooner than the configured workerLostTimeout.

    The fix adds a check in the Reconcile function: when readGroup returns ErrNoActiveClusters and the admission check is in Ready state, we:

    1. Compute the remaining wait time based on workerLostTimeout and the admission check's LastTransitionTime.
    2. If the remaining wait time is positive, return RequeueAfter: waitTime (no error), which causes the workload to be requeued after the remaining wait time.
    3. If the remaining wait time has passed, update the admission check to Retry state with the "Reserving remote lost" message.

    This ensures that:

    • The admitted workload remains in Ready state during a temporary worker disconnect.
    • The workload is only requeued (with the AC set to Retry) after the configured worker-loss timeout.
    • The reconnect logic for individual workers is not affected (each worker has its own lock and reconnection logic).

    Let me also verify the fix against the checklist:

  61. MiniMax Assistant

    The fix is complete. Let me check the checklist one more time:

    Checklist:

    1. If an error was reported in the issue description, I have successfully reproduced it.

      • Yes, I created a test that reproduces the issue: when all workers are reconnecting and the AC is Ready, the workload reconciler returns an error and the workload is requeued with the default backoff (5ms), which is too early.
    2. If an error was reported in the issue description, I have confirmed that my fix resolves the error.

      • Yes, after applying the fix, the test passes and the workload is requeued after the remaining workerLostTimeout (e.g., 2m30s for a workload that was admitted 2m30s ago with a 5m timeout).
    3. I have thought about edge cases and made sure my fix handles them as well.

      • Yes, I tested the following edge cases:
        • All workers disconnected, AC is Ready, timeout not exceeded (the new behavior).
        • All workers disconnected, AC is Ready, timeout exceeded (the AC is set to Retry).
        • All workers disconnected, AC is not Ready (the error is returned as before).
        • Some workers disconnected, some connected (the connected workers are used).
        • 2 workers both reconnecting (handled correctly).
        • Just became Ready, then disconnected (waits for full timeout).
    4. I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.

      • Yes, all tests in the multikueue package pass. I also ran the broader ./pkg/controller/... tests and they pass.
  62. MiniMax Assistant

    The fix is complete. Let me submit it:

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