Repository navigation
Speed up release plan creation - #1278
Merged
Merged
Conversation
Debug logs built multi-megabyte strings of the whole beholder cache and all packages on every plan even with INFO logging, because the objects were passed through str(). Pass them to logging as is. Download modules.yaml of all module tasks of a build concurrently instead of one by one, and drop a db.refresh() of the new release that only re-read its plan before get_final_release() reads it again. Also measure the beholder part of the plan separately (requests, cache build and repositories matching), since it takes most of the plan time and it is not known yet which of them is slow.
This file contains hidden or 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
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.
Problem
Creating a release plan takes up to 1–2 minutes on production. Stage timings of the last 30 releases from
performance_statsshow that Pulp and DB queries take ~1 s and the presence check is usually under 1 s, while 90%+ of the time is spent in the Beholder part ofget_release_plan, e.g.:The Beholder part isn't measured on its own, so it is unknown whether the time goes to the Beholder requests or to processing their responses.
Changes
Only changes that don't affect the resulting plan:
logging.debug("beholder_cache: %s", str(beholder_cache))and the same for all packages built multi-megabyte strings on every plan even with INFO logging. The objects are now passed tologgingas is, so they are formatted only when DEBUG is on. Same for the keys logged infind_release_repos.Build RPMsis logged at DEBUG instead of INFO.performance_statskeys:beholder_requests(all Beholder requests, module ones included, summed up),beholder_cache_buildandrelease_repos_matching. They show which part of the Beholder stage is slow before optimizing it further.modules.yamlof all module tasks of a build is downloaded concurrently, each repository once. A failed download is raised only if that template is actually used, so a task that is skipped later can't fail the plan.db.refresh(new_release)increate_new_release:get_final_release()reads the release right after it, so the refresh only transferred the plan JSON once more.Tests
New
tests/test_unit/test_release_planner.pycovers the concurrentmodules.yamldownload (one request per repository, failures returned instead of raised) and summing up of repeated stages.tests/test_api/test_releases.pyandtests/test_unit: 144 passed, 8 skipped.🤖 Generated with Claude Code