Delete assumedWorkloads field from cache#8474
Delete assumedWorkloads field from cache#8474k8s-ci-robot merged 8 commits intokubernetes-sigs:mainfrom
assumedWorkloads field from cache#8474Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
711fd72 to
af3b85f
Compare
assumedWorkloads field from cache
af3b85f to
b421657
Compare
91e395d to
a31e1d7
Compare
a31e1d7 to
5446f3f
Compare
|
https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/8474/pull-kueue-test-integration-baseline-main/2010655165719252992 |
|
/test pull-kueue-test-integration-baseline-main |
I'm looking into it |
5446f3f to
71d0278
Compare
It seems like the new added test was causing the problem. There I introduced a variable |
|
Ah, I see. We could probably just call |
| return false | ||
| } | ||
|
|
||
| func (c *Cache) AssumeWorkload(log logr.Logger, w *kueue.Workload) error { |
There was a problem hiding this comment.
Lovely to see this much code removed and all tests still pass ❤️ . Thank you for investigating 👍
mimowo
left a comment
There was a problem hiding this comment.
/lgtm
/approve
Thank you for the simplification, I couldn't see any problematic cases except for the error handling, but the new integration test shows it works well. Let's go with that,
|
LGTM label has been added. DetailsGit tree hash: bcd41dd3f2df4f5f6c147b6c0581e292a5ecfd02 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mimowo, PBundyra The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| func (c *Cache) AssumeWorkload(log logr.Logger, w *kueue.Workload) error { | ||
| c.Lock() | ||
| defer c.Unlock() |
There was a problem hiding this comment.
The "assume mechanism" could potentially contribute to avoiding lock-acquiring deadlock between controllers and the scheduler, which can improve kueue-controller-manager performance.
OTOH, AssumeWorkload takes an entire lock, as you can see here. So the current "assume mechanism" is no longer meaningful, I believe.
We can revisit the "assume mechanism" once we observe the cache lock-acquiring error many times.
@PBundyra Thank you 👍
* Comment assumed workloads in cache * Modify unit tests so they dont call AssumeWorkload but AddOrUpdate just like scheduler * Delete assumed workloads field, add an integration test * Fix verify lint * Cleanup ForgetWorkload func * Fix added test * Fix added test * Synchronize the numCalls counter in tests
* Comment assumed workloads in cache * Modify unit tests so they dont call AssumeWorkload but AddOrUpdate just like scheduler * Delete assumed workloads field, add an integration test * Fix verify lint * Cleanup ForgetWorkload func * Fix added test * Fix added test * Synchronize the numCalls counter in tests
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
After code analysis and experimenting what happens if we deleted
assumedWorkloadsI came to conclusion that it is redundant. Kueue doesn't leverage information about Workload being assumed, and it doesn't differ from just adding it to cache.AssumeWorkloadseventually adds it to the cache and the workload is treated as it was just added (not assumed). Hence this PR to simplify the code and maintenanceWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?