forked from kubernetes-sigs/kueue
-
Notifications
You must be signed in to change notification settings - Fork 0
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
DRAFT: Latest changes - Using Mutex #6
Open
ChristianZaccaria
wants to merge
6
commits into
main
Choose a base branch
from
restmapper-crd-start-rev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkg/controller/jobframework/setup.go
Outdated
return restMapping, nil | ||
} | ||
|
||
var defaultCheckAPIAvailable checkAPIAvailableFunc = func(mgr ctrl.Manager, gvk schema.GroupVersionKind) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: but let's make make the fun var to be descriptive.
Suggested change
var defaultCheckAPIAvailable checkAPIAvailableFunc = func(mgr ctrl.Manager, gvk schema.GroupVersionKind) (bool, error) { | |
var defaultCheckAPIAvailable fetchRestMapperFunc = func(mgr ctrl.Manager, gvk schema.GroupVersionKind) (bool, error) { |
ChristianZaccaria
force-pushed
the
restmapper-crd-start-rev
branch
from
August 7, 2024 14:35
eda7b17
to
27be9c7
Compare
ChristianZaccaria
changed the title
DRAFT: Latest changes
DRAFT: Latest changes - Using Mutex
Aug 7, 2024
…to streamline REST mapping checks
ChristianZaccaria
force-pushed
the
restmapper-crd-start-rev
branch
from
August 12, 2024 07:42
27be9c7
to
ba9d9f3
Compare
ChristianZaccaria
force-pushed
the
main
branch
2 times, most recently
from
October 11, 2024 07:44
7e3ed90
to
a768127
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tests are passing here.
There is need to use mutexes in production code as there is a real case of race conditions.
Case 1:
A number of Frameworks are not initially available, but eventually 3 CRDs are installed at the same time alongside a deployment of a component. The 3 running go routines will try at the same time to create a new
enabledIntegrations
set. Locks are essential in this case to avoid multiple creations ofenabledIntegrations
sets.Case 2:
The first Framework to be processed is not available, which will start a go routine. The CRD might become available milliseconds later and attempt to create the
enabledIntegrations
set, while the second Framework being processed had already created theenabledIntegrations
set.