Merge lp:~brian-murray/ubuntu-archive-tools/workaround-503 into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 1101
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/workaround-503
Merge into: lp:ubuntu-archive-tools
Diff against target: 47 lines (+12/-5)
1 file modified
phased-updater (+12/-5)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/workaround-503
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Review via email: mp+325029@code.launchpad.net

Description of the change

The phased-updater is running into 503 Errors, requests timing out, when trying to get binaries published from a source publication. My testing reveals that none of the source publications which create this issue are ones which are currently phasing. While just skipping the package is rather terrible, I think its better than having the phased-updater only successfully run for Trusty and Xenial (it OOPSes somewhere in the list of Xenial publications) and having the phased updates report be out of date.

I've reported Launchpad bug 1695113 about the specific OOPS and bug 1694816 regarding having a faster way to query for packages with a phased_update_percentage.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

Oh and for what it is worth these are the packages with which I encountered an error.

 $ ./phased-updater -n
Skipping 503 Error for xorg-lts-transitional
Skipping 503 Error for gcc-5-cross-ports

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phased-updater'
2--- phased-updater 2016-12-19 13:19:31 +0000
3+++ phased-updater 2017-06-02 22:02:33 +0000
4@@ -30,6 +30,7 @@
5 import codecs
6 import csv
7 import datetime
8+import lazr
9 import logging
10 import os
11 import simplejson as json
12@@ -572,24 +573,30 @@
13 releases.reverse()
14 issues = {}
15 for release in releases:
16+ # We can't use release.datereleased because some SRUs are 0 day
17+ cdate = release.date_created
18 rname = release.name
19 rvers = release.version
20 issues[rname] = OrderedDict()
21 # XXX - starting with raring
22 if rname in ['lucid', 'precise', 'vivid', 'wily']:
23 continue
24- # XXX - only look at updates since 21/06/2013
25- start_date = datetime.datetime(2013, 6, 21, 0, 0, 0, 0)
26 pub_sources = archive.getPublishedSources(
27- created_since_date=start_date,
28+ created_since_date=cdate,
29 order_by_date=True,
30 pocket='Updates', status='Published', distro_series=release)
31 for pub_source in pub_sources:
32 src_pkg = pub_source.source_package_name
33 version = pub_source.source_package_version
34 pbs = None
35- pbs = [pb for pb in pub_source.getPublishedBinaries()
36- if pb.phased_update_percentage is not None]
37+ try:
38+ pbs = [pb for pb in pub_source.getPublishedBinaries()
39+ if pb.phased_update_percentage is not None]
40+ # workaround for LP: #1695113
41+ except lazr.restfulclient.errors.ServerError as e:
42+ if 'HTTP Error 503' in str(e):
43+ logging.info('Skipping 503 Error for %s' % src_pkg)
44+ pass
45 if not pbs:
46 continue
47 if pbs:

Subscribers

People subscribed via source and target branches