Merge lp:~doanac/ubuntu-ci-services-itself/lander-retry-1289296 into lp:ubuntu-ci-services-itself

Proposed by Andy Doan
Status: Merged
Approved by: Francis Ginther
Approved revision: 353
Merged at revision: 362
Proposed branch: lp:~doanac/ubuntu-ci-services-itself/lander-retry-1289296
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 54 lines (+4/-19)
1 file modified
lander/lander/run_worker.py (+4/-19)
To merge this branch: bzr merge lp:~doanac/ubuntu-ci-services-itself/lander-retry-1289296
Reviewer Review Type Date Requested Status
Francis Ginther Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+210476@code.launchpad.net

Commit message

lander: try forever to connect to jenkins and ticket-system

There's no point ever giving up on connecting

Description of the change

fixes the issue where the lander stopped trying to connect to jenkins and the ticket system

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:353
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/379/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/379/rebuild

review: Approve (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lander/lander/run_worker.py'
2--- lander/lander/run_worker.py 2014-03-10 22:25:00 +0000
3+++ lander/lander/run_worker.py 2014-03-11 19:08:49 +0000
4@@ -26,7 +26,6 @@
5 from ci_utils import jenkins_utils
6 from ci_utils import dump_stack
7
8-MAX_RETRIES = 15
9 SERVICE_PATH = os.path.join(os.path.dirname(__file__), '../../juju-relations')
10
11 # set up a root logger for everything
12@@ -120,38 +119,24 @@
13
14
15 def main(args):
16- retries = MAX_RETRIES
17 logging.info('Starting lander-jenkins worker.')
18- while retries:
19+ while True:
20 logging.info('Trying to acquire jenkins config.')
21 jenkins_config = jenkins_utils.get_config()
22 if not jenkins_config:
23- retries -= 1
24- logging.error('Unable to acquire jenkins configuration, '
25- 'will retry {} more times.'.format(retries))
26+ logging.error('Unable to acquire jenkins configuration, retrying')
27 time.sleep(args.delay)
28 else:
29 break
30- if not retries:
31- logging.error('Failed to acquire jenkins configuration, '
32- 'no more retries.')
33- return -1
34
35- retries = MAX_RETRIES
36- while retries:
37+ while True:
38 logging.info('Trying to acquire ticket service url.')
39 service_url = get_service_url(args.service_name, args.service_port)
40 if not service_url:
41- retries -= 1
42- logging.error('Unable to acquire ticket service url, '
43- 'will retry {} more times.'.format(retries))
44+ logging.error('Unable to acquire ticket service url, retrying')
45 time.sleep(args.delay)
46 else:
47 break
48- if not retries:
49- logging.error('Failed to acquire ticket service url, '
50- 'no more retries.')
51- return -1
52
53 while True:
54 logging.info('Polling for a new ticket')

Subscribers

People subscribed via source and target branches