Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix data race while setting delta cluster state in parallel #7696

Conversation

macsko
Copy link
Member

@macsko macsko commented Jan 15, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

Clearing caches while adding a pod was causing data race. This step is redundant when setting cluster state, as cache is empty anyway.

Which issue(s) this PR fixes:

See #7695

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

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


@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 15, 2025
@k8s-ci-robot k8s-ci-robot requested a review from x13n January 15, 2025 12:44
@macsko
Copy link
Member Author

macsko commented Jan 15, 2025

/cc @x13n

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 15, 2025
Copy link
Member

@x13n x13n left a comment

Choose a reason for hiding this comment

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

I think we should still clear the cache once after setting cluster state?

@macsko macsko force-pushed the fix_data_race_while_setting_delta_cluster_state_in_parallel branch from 51a805c to b36e387 Compare January 15, 2025 13:29
@macsko
Copy link
Member Author

macsko commented Jan 15, 2025

I think we should still clear the cache once after setting cluster state?

That's right. I didn't notice the snapshot.data.addNode(node) modifies nodeInfoList cache. Fixed

@x13n
Copy link
Member

x13n commented Jan 15, 2025

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 15, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: macsko, x13n

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

The pull request process is described here

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 merged commit adda3d4 into kubernetes:master Jan 15, 2025
6 checks passed
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. area/cluster-autoscaler 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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants