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
=== modified file 'phased-updater'
--- phased-updater 2016-12-19 13:19:31 +0000
+++ phased-updater 2017-06-02 22:02:33 +0000
@@ -30,6 +30,7 @@
30import codecs30import codecs
31import csv31import csv
32import datetime32import datetime
33import lazr
33import logging34import logging
34import os35import os
35import simplejson as json36import simplejson as json
@@ -572,24 +573,30 @@
572 releases.reverse()573 releases.reverse()
573 issues = {}574 issues = {}
574 for release in releases:575 for release in releases:
576 # We can't use release.datereleased because some SRUs are 0 day
577 cdate = release.date_created
575 rname = release.name578 rname = release.name
576 rvers = release.version579 rvers = release.version
577 issues[rname] = OrderedDict()580 issues[rname] = OrderedDict()
578 # XXX - starting with raring581 # XXX - starting with raring
579 if rname in ['lucid', 'precise', 'vivid', 'wily']:582 if rname in ['lucid', 'precise', 'vivid', 'wily']:
580 continue583 continue
581 # XXX - only look at updates since 21/06/2013
582 start_date = datetime.datetime(2013, 6, 21, 0, 0, 0, 0)
583 pub_sources = archive.getPublishedSources(584 pub_sources = archive.getPublishedSources(
584 created_since_date=start_date,585 created_since_date=cdate,
585 order_by_date=True,586 order_by_date=True,
586 pocket='Updates', status='Published', distro_series=release)587 pocket='Updates', status='Published', distro_series=release)
587 for pub_source in pub_sources:588 for pub_source in pub_sources:
588 src_pkg = pub_source.source_package_name589 src_pkg = pub_source.source_package_name
589 version = pub_source.source_package_version590 version = pub_source.source_package_version
590 pbs = None591 pbs = None
591 pbs = [pb for pb in pub_source.getPublishedBinaries()592 try:
592 if pb.phased_update_percentage is not None]593 pbs = [pb for pb in pub_source.getPublishedBinaries()
594 if pb.phased_update_percentage is not None]
595 # workaround for LP: #1695113
596 except lazr.restfulclient.errors.ServerError as e:
597 if 'HTTP Error 503' in str(e):
598 logging.info('Skipping 503 Error for %s' % src_pkg)
599 pass
593 if not pbs:600 if not pbs:
594 continue601 continue
595 if pbs:602 if pbs:

Subscribers

People subscribed via source and target branches