Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Side by Side Diff: commit-queue/pending_manager.py

Issue 62273005: CQ: catch more exceptions when looking for new pending changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding=utf8 1 # coding=utf8
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Commit queue manager class. 5 """Commit queue manager class.
6 6
7 Security implications: 7 Security implications:
8 8
9 The following hypothesis are made: 9 The following hypothesis are made:
10 - Commit queue: 10 - Commit queue:
11 - Impersonate the same svn credentials that the patchset owner. 11 - Impersonate the same svn credentials that the patchset owner.
12 - Can't impersonate a non committer. 12 - Can't impersonate a non committer.
13 - SVN will check the committer write access. 13 - SVN will check the committer write access.
14 """ 14 """
15 15
16 import errno
16 import logging 17 import logging
17 import os 18 import os
19 import socket
20 import ssl
18 import time 21 import time
19 import traceback 22 import traceback
20 import urllib2 23 import urllib2
21 24
22 import find_depot_tools # pylint: disable=W0611 25 import find_depot_tools # pylint: disable=W0611
23 import checkout 26 import checkout
24 import git_cl 27 import git_cl
25 import patch 28 import patch
26 import ssl
27 import subprocess2 29 import subprocess2
28 30
29 import errors 31 import errors
30 import model 32 import model
31 from verification import base 33 from verification import base
32 34
33 35
34 class PendingCommit(base.Verified): 36 class PendingCommit(base.Verified):
35 """Represents a pending commit that is being processed.""" 37 """Represents a pending commit that is being processed."""
36 # Important since they tell if we need to revalidate and send try jobs 38 # Important since they tell if we need to revalidate and send try jobs
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 pending, 188 pending,
187 { 'verification': 'abort', 189 { 'verification': 'abort',
188 'payload': { 190 'payload': {
189 'output': 'CQ bit was unchecked on CL. Ignoring.' }}) 191 'output': 'CQ bit was unchecked on CL. Ignoring.' }})
190 pending.get_state = lambda: base.IGNORED 192 pending.get_state = lambda: base.IGNORED
191 self._discard_pending(pending, None) 193 self._discard_pending(pending, None)
192 194
193 # Find new issues. 195 # Find new issues.
194 for issue_id in new_issues: 196 for issue_id in new_issues:
195 if str(issue_id) not in self.queue.pending_commits: 197 if str(issue_id) not in self.queue.pending_commits:
196 issue_data = self.context.rietveld.get_issue_properties( 198 try:
197 issue_id, True) 199 issue_data = self.context.rietveld.get_issue_properties(
200 issue_id, True)
201 except urllib2.HTTPError as e:
202 if e.code in (500, 502, 503):
203 # Temporary AppEngine hiccup. Just log it and continue.
204 logging.warning(str(e))
Ryan Tseng 2013/11/16 01:38:37 logging.warning('%s while accessing %s. Ignoring
205 continue
206 raise
Ryan Tseng 2013/11/16 01:38:37 "raise e" so we can propagate this downstream. Al
207 except urllib2.URLError as e:
208 # Temporary AppEngine hiccup. Just log it and continue.
209 if 'timed out' in e.reason:
210 logging.warning(str(e))
Ryan Tseng 2013/11/16 01:38:37 Make this more verbose. '%s while accessing rietve
211 continue
212 raise
213 except socket.error as e:
214 # Temporary AppEngine hiccup. Just log it and continue.
215 if e.errno == errno.ECONNRESET:
216 logging.warning(str(e))
217 continue
218 raise
219 except IOError as e:
220 # Temporary AppEngine hiccup. Just log it and continue.
221 if e.errno == 'socket error':
222 logging.warning(str(e))
223 continue
224 raise
198 # This assumption needs to hold. 225 # This assumption needs to hold.
199 assert issue_id == issue_data['issue'] 226 assert issue_id == issue_data['issue']
200 if issue_data['patchsets'] and issue_data['commit']: 227 if issue_data['patchsets'] and issue_data['commit']:
201 logging.info('Found new issue %d' % issue_id) 228 logging.info('Found new issue %d' % issue_id)
202 self.queue.add( 229 self.queue.add(
203 PendingCommit( 230 PendingCommit(
204 issue=issue_id, 231 issue=issue_id,
205 owner=issue_data['owner_email'], 232 owner=issue_data['owner_email'],
206 reviewers=issue_data['reviewers'], 233 reviewers=issue_data['reviewers'],
207 patchset=issue_data['patchsets'][-1], 234 patchset=issue_data['patchsets'][-1],
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 """Loads the commit queue state from a JSON file.""" 554 """Loads the commit queue state from a JSON file."""
528 self.queue = model.load_from_json_file(filename) 555 self.queue = model.load_from_json_file(filename)
529 556
530 def save(self, filename): 557 def save(self, filename):
531 """Save the commit queue state in a simple JSON file.""" 558 """Save the commit queue state in a simple JSON file."""
532 model.save_to_json_file(filename, self.queue) 559 model.save_to_json_file(filename, self.queue)
533 560
534 def close(self): 561 def close(self):
535 """Close all the active pending manager items.""" 562 """Close all the active pending manager items."""
536 self.context.status.close() 563 self.context.status.close()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698