Changeset 70092 in webkit
- Timestamp:
- Oct 19, 2010 3:06:52 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r70088 r70092 1 2010-10-19 Eric Seidel <eric@webkit.org> 2 3 Unreviewed. Will get Adam's commentary after his meeting 4 for now this gets the commit-cluster back running. 5 6 commit-queue gets stuck when release-patch returns 404 7 https://bugs.webkit.org/show_bug.cgi?id=47935 8 9 I taught NetworkTransaction the basics of 404 handling. 10 We'll want to go back and teach it how to handle urllib2 404's too 11 and then deploy it to the places that want it. 12 13 * QueueStatusServer/handlers/releasepatch.py: 14 * Scripts/webkitpy/common/net/buildbot.py: 15 * Scripts/webkitpy/common/net/networktransaction.py: 16 * Scripts/webkitpy/common/net/statusserver.py: 17 1 18 2010-10-19 Eric Seidel <eric@webkit.org> 2 19 -
trunk/WebKitTools/QueueStatusServer/handlers/releasepatch.py
r70088 r70092 50 50 attachment = Attachment(attachment_id) 51 51 last_status = attachment.status_for_queue(queue) 52 if not last_status:53 self.error(404)54 return55 52 56 53 # Ideally we should use a transaction for the calls to … … 58 55 59 56 # Only remove it from the queue if the last message is not a retry request. 60 if not last_status.is_retry_request(): 57 # Allow removing it from the queue even if there is no last_status for easier testing. 58 if not last_status or not last_status.is_retry_request(): 61 59 queue.work_items().remove_work_item(attachment_id) 62 60 -
trunk/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
r69829 r70092 109 109 def _fetch_revision_to_build_map(self): 110 110 # All _fetch requests go through _buildbot for easier mocking 111 # FIXME: This should use NetworkTransaction's 404 handling instead. 111 112 try: 112 113 # FIXME: This method is horribly slow due to the huge network load. … … 218 219 def _fetch_results_html(self): 219 220 results_html = "%s/results.html" % (self.results_url()) 220 # FIXME: We need to move this sort of 404 logic into NetworkTransaction or similar.221 # FIXME: This should use NetworkTransaction's 404 handling instead. 221 222 try: 222 223 return urllib2.urlopen(results_html) -
trunk/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
r56897 r70092 30 30 import time 31 31 32 from webkitpy.thirdparty.autoinstalled .mechanize import HTTPError32 from webkitpy.thirdparty.autoinstalled import mechanize 33 33 from webkitpy.common.system.deprecated_logging import log 34 34 … … 42 42 43 43 class NetworkTransaction(object): 44 def __init__(self, initial_backoff_seconds=10, grown_factor=1.5, timeout_seconds= 10*60):44 def __init__(self, initial_backoff_seconds=10, grown_factor=1.5, timeout_seconds=(10 * 60), convert_404_to_None=False): 45 45 self._initial_backoff_seconds = initial_backoff_seconds 46 46 self._grown_factor = grown_factor … … 53 53 try: 54 54 return request() 55 except HTTPError, e: 55 # FIXME: We should catch urllib2.HTTPError here too. 56 except mechanize.HTTPError, e: 57 if convert_404_to_None and e.code == 404: 58 return None 56 59 self._check_for_timeout() 57 60 _log.warn("Received HTTP status %s from server. Retrying in " -
trunk/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
r70088 r70092 118 118 def release_work_item(self, queue_name, patch): 119 119 _log.debug("Releasing work item %s from %s" % (patch.id(), queue_name)) 120 return NetworkTransaction( ).run(lambda: self._post_release_work_item(queue_name, patch))120 return NetworkTransaction(convert_404_to_None=True).run(lambda: self._post_release_work_item(queue_name, patch)) 121 121 122 122 def update_work_items(self, queue_name, work_items): … … 133 133 134 134 def _fetch_url(self, url): 135 # FIXME: This should use NetworkTransaction's 404 handling instead. 135 136 try: 136 137 return urllib2.urlopen(url).read()
Note: See TracChangeset
for help on using the changeset viewer.