Skip to content
TheChatArchiveThe Chat Archive
gpt-5.6-sol· openaiHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Standalone elastic RayCluster self-updates raycluster-generation…

  1. User

    ISSUE DESCRIPTION

    Standalone elastic RayCluster self-updates raycluster-generation annotation What happened:

    A standalone Kueue-managed elastic RayCluster is continuously updated by Kueue.

    The kueue.x-k8s.io/raycluster-generation annotation tracks the RayCluster's own metadata.generation, but remains one value behind. For example:

    metadata.generation: 273390
    kueue.x-k8s.io/raycluster-generation: "273389"
    

    A later read showed the same pattern:

    metadata.generation: 273462
    kueue.x-k8s.io/raycluster-generation: "273461"
    

    Kueue logs showed repeated RayCluster reconciles followed by RayCluster update webhook calls from the Kueue controller manager.

    This is a self-triggered loop in the RayCluster custom annotation path. For standalone RayClusters, GetCustomAnnotations calls GetWorkloadslicingRayClusterCustomAnnotations(ctx, c, j.Object(), podSets, j.Name). That helper fetches the same RayCluster and returns the fetched RayCluster generation as an annotation to write back onto the RayCluster. The metadata patch then advances the RayCluster generation, making the annotation stale again.

    What you expected to happen:

    Kueue should not continuously patch a standalone elastic RayCluster when its replica counts have not changed.

    The raycluster-generation annotation is useful for RayJob and RayService, where the top-level object needs to account for an underlying RayCluster generation. A standalone RayCluster should not write its own generation back onto itself.

    How to reproduce it (as minimally and precisely as possible):

    1. Install Kueue v0.16.5 with ElasticJobsViaWorkloadSlices=true.
    2. Enable the RayCluster integration.
    3. Create a standalone RayCluster with:
    metadata:
      annotations:
        kueue.x-k8s.io/elastic-job: "true"
      labels:
        kueue.x-k8s.io/queue-name: <local-queue>
    
    1. Inspect the RayCluster generation and annotation repeatedly:
    kubectl get raycluster.ray.io <name> -n <namespace> \
      -o jsonpath='{.metadata.generation}{"\t"}{.metadata.annotations.kueue\.x-k8s\.io/raycluster-generation}{"\n"}'
    

    Anything else we need to know?:

    This may be related to #10160, which added generation-based elastic workload names on the release-0.16 branch.

    A fix is to omit kueue.x-k8s.io/raycluster-generation when the jobObject is the same standalone RayCluster as rayClusterName.

    Environment:

    • Kubernetes version (use kubectl version):
      • Client Version: v1.33.9
      • Server Version: v1.33.10-gke.1115000
    • Kueue version (use git describe --tags --dirty --always):
      • Deployed controller image: kueue:v0.16.5
      • Helm chart: kueue-0.16.5
    • Cloud provider or hardware configuration: GKE
    • OS (e.g: cat /etc/os-release): not collected
    • Kernel (e.g. uname -a): not collected
    • Install tools: Helm
    • Others:
      • ElasticJobsViaWorkloadSlices=true
      • TopologyAwareScheduling=false

    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. Assistant

    I’ll locate the Ray integration and annotation helper, inspect existing tests and call sites, then reproduce the problematic standalone behavior at unit-test level before making the smallest targeted source change. Afterward I’ll run the relevant test packages and review the diff.

  3. Assistant

    rg is unavailable in the environment, so I’ll use recursive grep to find the implementation and tests.

  4. Assistant

    The shared helper is used by RayJob and RayService; I’ll inspect its identity/generation logic and the standalone RayCluster adapter, plus the current table tests, to determine whether the guard belongs centrally or in the standalone call site.

  5. Assistant

    The helper currently always fetches and returns the generation. I’ll inspect the standalone controller’s GetCustomAnnotations implementation and the full test table setup so the fix preserves RayJob/RayService behavior and handles exact object identity correctly.

  6. Assistant

    On this checkout, standalone RayCluster does not yet implement JobWithCustomAnnotations, while the issue describes that call path. I’ll inspect interface usage and recent history/branches around elastic workload naming to understand whether the intended fix should be a helper-level same-object guard (which also future-proofs standalone callers) rather than removing a call that is absent here.

  7. Assistant

    The safest condition is not name equality alone: a RayJob can share a name with its underlying cluster. The helper should recognize a canonical *rayv1.RayCluster whose namespace/name matches rayClusterName, return only replica-size metadata, and avoid fetching its own generation. Existing ConfigMap-based tests already guard against accidentally treating all same-named objects as standalone clusters.

    Before editing, I’ll run a temporary external reproduction program (outside the repository, so no tests are added or modified) that invokes the helper with a standalone RayCluster and confirms the current unwanted generation annotation.

  8. Assistant

    The first reproduction attempt used the wrong feature helper import path. I’ll read the source imports and correct the temporary program.

  9. Assistant

    I’ll correct the import and enable the feature gate in the reproduction, matching the reported configuration.

  10. Assistant

    Go requires an explicit cache path in this stripped environment; I’ll rerun with a temporary cache.

  11. Assistant

    The reproduction confirms generation 42 is returned for the object itself. I’ll inspect merge semantics before editing: if omission merely leaves an already-present stale annotation, that still stops the loop, but it determines whether explicit deletion is needed or consistent with the requested “omit” behavior.

  12. Assistant

    The first excerpt missed the function body; I’ll open the exact lines.

  13. Assistant

    Omitted keys are not deleted by mergeAnnotations; importantly, they also cannot cause further patches. Thus the targeted behavior is to return the replica-size annotation but not the self-generation key. I’ll add the standalone identity guard before the client Get, preserving generation tracking and error behavior for RayJob/RayService and avoiding the self-read entirely.

  14. Assistant

    The same reproduction now returns only replica sizes, confirming the self-generation annotation is omitted. Next I’ll run the RayCluster package tests, then RayJob and RayService tests because they rely on the helper and must continue receiving underlying-cluster generation annotations.

  15. Assistant

    All directly affected packages pass. Edge-case coverage is also preserved by existing tests: a non-RayCluster top-level object with the same name still receives generation metadata, missing underlying clusters still return the established empty generation value, and client errors still propagate. I’ll now run formatting/whitespace checks and inspect the final diff and repository status for unintended changes.

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