Merge ~cjwatson/launchpad:ifp-logging into launchpad:master

Proposed by Colin Watson on 2019-10-04
Status: Merged
Approved by: Colin Watson on 2019-10-11
Approved revision: 0f69e8ce208f681f28633843b1f68a66619a8367
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:ifp-logging
Merge into: launchpad:master
Diff against target: 76 lines (+9/-0)
1 file modified
lib/lp/soyuz/scripts/initialize_distroseries.py (+9/-0)
Reviewer Review Type Date Requested Status
William Grant code 2019-10-04 Approve on 2019-10-11
Review via email: mp+373694@code.launchpad.net

Commit message

Add a bit more logging to InitializeDistroSeries

This job takes quite a long time with no feedback. Even though we only
run it every six months, it'd be nice to have a little more of an idea
of how far it's got and where the slow parts are.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/soyuz/scripts/initialize_distroseries.py b/lib/lp/soyuz/scripts/initialize_distroseries.py
2index 9d8a64b..6a9753e 100644
3--- a/lib/lp/soyuz/scripts/initialize_distroseries.py
4+++ b/lib/lp/soyuz/scripts/initialize_distroseries.py
5@@ -24,6 +24,7 @@ from lp.services.database import bulk
6 from lp.services.database.interfaces import IMasterStore
7 from lp.services.database.sqlbase import sqlvalues
8 from lp.services.helpers import ensure_unicode
9+from lp.services.scripts import log
10 from lp.soyuz.adapters.packagelocation import PackageLocation
11 from lp.soyuz.enums import (
12 ArchivePurpose,
13@@ -296,6 +297,7 @@ class InitializeDistroSeries:
14 transaction.commit()
15
16 def _set_parents(self):
17+ log.info("Setting distroseries parents.")
18 count = 0
19 for parent in self.parents:
20 dsp_set = getUtility(IDistroSeriesParentSet)
21@@ -332,6 +334,7 @@ class InitializeDistroSeries:
22 return set(previous_series_parents) == set(self.parents)
23
24 def _create_dsds(self):
25+ log.info("Creating DistroSeriesDifferences.")
26 if not self.first_derivation:
27 if (self._has_same_parents_as_previous_series() and
28 self.packagesets_ids is None):
29@@ -373,6 +376,7 @@ class InitializeDistroSeries:
30 job_source.massCreateForSeries(self.distroseries)
31
32 def _copy_configuration(self):
33+ log.info("Copying distroseries configuration from parents.")
34 self.distroseries.backports_not_automatic = any(
35 parent.backports_not_automatic
36 for parent in self.derivation_parents)
37@@ -392,6 +396,7 @@ class InitializeDistroSeries:
38 for parent in self.derivation_parents)
39
40 def _copy_architectures(self):
41+ log.info("Copying distroarchseries from parents.")
42 das_filter = ' AND distroseries IN %s ' % (
43 sqlvalues([p.id for p in self.derivation_parents]))
44 if self.arches:
45@@ -408,6 +413,7 @@ class InitializeDistroSeries:
46 self._store.flush()
47
48 def _set_nominatedarchindep(self):
49+ log.info("Setting nominated arch-indep configuration.")
50 if self.archindep_archtag is None:
51 # Select the arch-indep builder from the intersection between
52 # the selected architectures and the list of the parent's
53@@ -433,6 +439,7 @@ class InitializeDistroSeries:
54
55 def _copy_packages(self):
56 # Perform the copies
57+ log.info("Copying packages from parents.")
58 self._copy_component_section_and_format_selections()
59
60 # Prepare the lists of distroarchseries for which binary packages
61@@ -689,6 +696,7 @@ class InitializeDistroSeries:
62
63 def _copy_packagesets(self):
64 """Copy packagesets from the parent distroseries."""
65+ log.info("Copying packagesets from parents.")
66 packagesets = self._store.find(
67 Packageset,
68 Packageset.distroseries_id.is_in(self.derivation_parent_ids))
69@@ -763,6 +771,7 @@ class InitializeDistroSeries:
70
71 def _copy_pocket_permissions(self):
72 """Copy per-distroseries/pocket permissions from the parent series."""
73+ log.info("Copying permissions from parents.")
74 for parent in self.derivation_parents:
75 if self.distroseries.distribution == parent.distribution:
76 self._store.execute("""

Subscribers

People subscribed via source and target branches