Skip to content

Handle opportunistic batching correctly during PodGroup scheduling cycle#138754

Merged
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
macsko:handle_opportunistic_batching_for_podgroups
May 4, 2026
Merged

Handle opportunistic batching correctly during PodGroup scheduling cycle#138754
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
macsko:handle_opportunistic_batching_for_podgroups

Conversation

@macsko

@macsko macsko commented May 4, 2026

Copy link
Copy Markdown
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR allows the batch result to be reused for pods from the same pod group during the pod group scheduling cycle. All pods during that cycle share the same cycle count. Before, such behavior made the batch state incompatible.

Which issue(s) this PR is related to:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fixed the inconsistency between opportunistic batching and PodGroups that made the batching hints always infeasible during PodGroup scheduling cycle.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 4, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 4, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: macsko

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2026
@k8s-ci-robot k8s-ci-robot requested review from AxeZhan and tosi3k May 4, 2026 13:13
@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label May 4, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label May 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in SIG Scheduling May 4, 2026
@tosi3k

tosi3k commented May 4, 2026

Copy link
Copy Markdown
Member

/retest

// In this case, a previous pod was scheduled by another profile, meaning we can't use the state anymore.
if cycleCount != b.lastCycle.cycleCount+1 {
// In case of PodGroup scheduling cycle, multiple pods can share the same cycle count.
if cycleCount != b.lastCycle.cycleCount && cycleCount != b.lastCycle.cycleCount+1 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the cycleCount != b.lastCycle.cycleCount check be actually hidden behind the GenericWorkload feature gate?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such case shouldn't happen without PodGroup scheduling cycle, but added a feature gate check for clarity, PTAL

@macsko macsko force-pushed the handle_opportunistic_batching_for_podgroups branch from e3bd12d to 0d9aca8 Compare May 4, 2026 15:28
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 4, 2026
@vshkrabkov

Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 1971777d3daec811e2bd9d630ea5285904f40547

@tosi3k

tosi3k commented May 4, 2026

Copy link
Copy Markdown
Member

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit b5f28ad into kubernetes:master May 4, 2026
13 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.37 milestone May 4, 2026
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in SIG Scheduling May 4, 2026
jjcfatras added a commit to jjcfatras/Claude that referenced this pull request May 5, 2026
Move diff parsing, three dedup passes, the confidence/severity gate,
inline-eligibility snapping, and payload + fallback rendering out of
skill prose and into ~/.claude/bin/code-review-helper. Cuts the skill
body roughly in half (-156 / +33 net) and makes every deterministic
rule unit-tested + golden-tested against three real OSS PR fixtures
(vercel/next.js#93491, kubernetes/kubernetes#138754, prisma/prisma
#29514).

Capturing those fixtures uncovered three accuracy bugs in the dedup
logic, all fixed in this commit with regression tests:

- Semantic dedup duplicate-emit: in[i] = keep mutation left the
  surviving finding at two slice slots, so the final loop emitted it
  twice. Replaced the in-place rewrite with a current-by-ID map +
  preserved-order slice.
- Cross-ref cascade: positional dedup mutated Explanation to embed
  the dropped peer's file path, which then tripped semantic Rule 1
  on any later finding in that file. Cross-refs now live on a new
  Finding.CrossRefs []CrossRef field rendered at output time; the
  matchers always see the specialist's pristine Explanation.
- Non-deterministic positional sort tiebreak when conf, domain, and
  specialist all matched. Added a final cluster[i].ID < cluster[j].ID
  comparator.

Settings hook now routes .go files through gofmt and other extensions
through prettier, and tools/code-review-helper/bin/ is gitignored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants