Skip to content

Commit

Permalink
Make publication of repos non-blocking [RHELDST-6394]
Browse files Browse the repository at this point in the history
Previously ubipop waited for each triplet of repos
(binary, debug, source) that were currently
in processing until publication of those repos
is finished. Only after publication finished,
ubipop was allowed to start processing another triplet.
As repo triplet is independent from other ones, it's
not required to do this in blocking way. So now
publication of repos is triggered at the same time
as before but waiting for all to finish is moved to
end of ubipop processing.
  • Loading branch information
rbikar committed Aug 11, 2021
1 parent 246e913 commit ca23cc2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ubipop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ def populate_ubi_repos(self):
# multiple times, to avoid that, cache the content sets already used and skip the config
# whose content sets are all in the cache

awaited_repos_publishes = []

for config in sorted(self.ubiconfig_list, key=str):
content_sets = [
config.content_sets.rpm.output,
Expand Down Expand Up @@ -275,7 +277,7 @@ def populate_ubi_repos(self):
right_config = self._get_config(
repo_set.out_repos.rpm.ubi_config_version, config
)
UbiPopulateRunner(
repos_publishes = UbiPopulateRunner(
self.pulp,
self.pulp_client,
repo_set,
Expand All @@ -285,6 +287,13 @@ def populate_ubi_repos(self):
).run_ubi_population()

out_repos.update(repo_set.get_output_repo_ids())
# in case of dry-run there are no publications expected
if repos_publishes:
awaited_repos_publishes.extend(repos_publishes)

# wait until publication of all repos is finished
if awaited_repos_publishes:
f_sequence(awaited_repos_publishes).result()

if self.output_repos:
with open(self.output_repos, "w") as f:
Expand Down Expand Up @@ -722,8 +731,8 @@ def run_ubi_population(self):
(mdd_association,), (mdd_unassociation,)
)

# wait repo publication
f_sequence(self._publish_out_repos()).result()
# return list of futures with repo publishes
return self._publish_out_repos()

def _associate_unassociate_units(self, action_list):
fts = []
Expand Down

0 comments on commit ca23cc2

Please sign in to comment.