-
Notifications
You must be signed in to change notification settings - Fork 135
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
ROX-23714: Lazy load registry repo list #11163
Closed
Closed
+1,917
−108
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
Skipping CI for Draft Pull Request. |
Images are ready for the commit at 10aec9c. To use with deploy scripts, first |
updates for rocksdb removal
Rebases gone bad... closing |
#11186 <- new PR |
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.
Description
Currently when Central starts all integrations are loaded into memory sequentially. For each integration a list of associated repositories is created. Populating this list takes time and delays Central startup (ref).
The repo list is used when determining if a registry integration is a match for an image.
Instead of loading the initial repo list when creating a new image integration, load it lazily upon first call to Match (and then as usual on subsequent calls).
This will result in faster Central startup and reduced initial memory consumption.
In the future repo list should be removed entirely, ACS may be making a wrong assumption that if a repo is not in the list then it is not in the registry, which is contrary to this doc:
Checklist
If any of these don't apply, please comment below.
Testing Performed
Unit tests as well as an infra OCP cluster with a mock registry deployed (broken-image-reg) configured to add a 10 second delay to the
/v2/_catalog
repo list calls - and 20 pull secrets with unique routes to the broken registry created in the OCP cluster.Without the fix, Central startup is delayed just under two minutes:
A followup roxctl image scan returns instantly (error expected):
With the fix, Central starts up faster:
The initial repo list load is instead made during the first call to match, which is demonstrated via a roxctl image scan. Notice how it returns after about 10 seconds (the timeout set on the
/v2/_catalog
endpoint):A second call to roxctl returns immediately indicating the repo list call is/was not made again: