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 race condition on delete workload from queue manager. #2460

Conversation

mbobrovskyi
Copy link
Contributor

@mbobrovskyi mbobrovskyi commented Jun 21, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Fix race condition on delete workload from queue manager.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

I found it locally when test using golang.org/x/tools/cmd/stress.

WARNING: DATA RACE
Write at 0x00c0012ad0b0 by goroutine 1313:
  runtime.mapassign_faststr()
      /Users/mykhailo_bobrovskyi/go/pkg/mod/golang.org/[email protected]/src/runtime/map_faststr.go:203 +0x41c
  sigs.k8s.io/kueue/pkg/queue.(*ClusterQueue).Delete()
      /Users/mykhailo_bobrovskyi/Projects/epam/kueue/pkg/queue/cluster_queue.go:194 +0x10c
  sigs.k8s.io/kueue/pkg/queue.(*Manager).deleteWorkloadFromQueueAndClusterQueue()
      /Users/mykhailo_bobrovskyi/Projects/epam/kueue/pkg/queue/manager.go:377 +0x1c4
  sigs.k8s.io/kueue/pkg/queue.(*Manager).DeleteWorkload()
      /Users/mykhailo_bobrovskyi/Projects/epam/kueue/pkg/queue/manager.go:365 +0xec
  sigs.k8s.io/kueue/pkg/controller/core.(*WorkloadReconciler).Update()
      /Users/mykhailo_bobrovskyi/Projects/epam/kueue/pkg/controller/core/workload_controller.go:661 +0x1840
  sigs.k8s.io/controller-runtime/pkg/internal/source.(*EventHandler).OnUpdate()
      /Users/mykhailo_bobrovskyi/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/event_handler.go:113 +0x49c

Does this PR introduce a user-facing change?

Fix race condition on delete workload from queue manager.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. labels Jun 21, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 21, 2024
@mbobrovskyi
Copy link
Contributor Author

/test all

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 21, 2024
Copy link

netlify bot commented Jun 21, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 5fa3f00
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/66751b3b7256170008d1e810
😎 Deploy Preview https://deploy-preview-2460--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mbobrovskyi mbobrovskyi marked this pull request as ready for review June 21, 2024 06:31
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 21, 2024
@alculquicondor
Copy link
Contributor

/lgtm
/approve

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 55a12e2bff37cd5f358c8fef42791cebd363ae38

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, mbobrovskyi

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2024
@alculquicondor
Copy link
Contributor

I wonder if we can add -race to our integration tests. Maybe that would have caught this.

@mbobrovskyi
Copy link
Contributor Author

/retest

@mbobrovskyi
Copy link
Contributor Author

/test pull-kueue-test-multikueue-e2e-main

@k8s-ci-robot k8s-ci-robot merged commit 0ce0e2f into kubernetes-sigs:main Jun 21, 2024
15 of 16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.8 milestone Jun 21, 2024
@mbobrovskyi mbobrovskyi deleted the fix/race-condition-on-delete-workload-from-queue-and-cluster-queue branch June 21, 2024 16:39
@mbobrovskyi
Copy link
Contributor Author

/cherry-pick release-0.7

@k8s-infra-cherrypick-robot
Copy link
Contributor

@mbobrovskyi: new pull request created: #2465

In response to this:

/cherry-pick release-0.7

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.

kannon92 pushed a commit to openshift-kannon92/kubernetes-sigs-kueue that referenced this pull request Nov 19, 2024
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants