Skip to content

Commit

Permalink
Fix depsolving perf-issues by doing repoclosure once.
Browse files Browse the repository at this point in the history
backports #9387.
[nocoverage]

fixes #9388

(cherry picked from commit 4594deb)
  • Loading branch information
dralley committed Sep 22, 2021
1 parent d307856 commit f0e1a78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES/9388.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Vastly improved copy-with-depsolving performance.
(backported from #9387)
8 changes: 4 additions & 4 deletions pulp_rpm/app/depsolving.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,11 +803,11 @@ def run_solver_jobs(jobs):

solvables_to_copy = set(solvables)
result_solvables = set()
install_jobs = []

while solvables_to_copy:
# Take one solvable
solvable = solvables_to_copy.pop()
install_jobs = []

if solvable.name.startswith("module:"):
# If the solvable being installed is a module, try to install it and all of its
Expand All @@ -830,9 +830,9 @@ def run_solver_jobs(jobs):
unit_install_job = self._pool.Job(flags, solvable.id)
install_jobs.append(unit_install_job)

# Depsolve using the list of unit install jobs, add them to the results
solvables_copied = run_solver_jobs(install_jobs)
result_solvables.update(solvables_copied)
# Depsolve using the list of unit install jobs, add them to the results
solvables_copied = run_solver_jobs(install_jobs)
result_solvables.update(solvables_copied)

solved_units = self.mapping.get_units_from_solvables(result_solvables)
for k in unit_repo_map.keys():
Expand Down

0 comments on commit f0e1a78

Please sign in to comment.