Changeset 70092 in webkit


Ignore:
Timestamp:
Oct 19, 2010 3:06:52 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-10-19 Eric Seidel <eric@webkit.org>

Unreviewed. Will get Adam's commentary after his meeting
for now this gets the commit-cluster back running.

commit-queue gets stuck when release-patch returns 404
https://bugs.webkit.org/show_bug.cgi?id=47935

I taught NetworkTransaction the basics of 404 handling.
We'll want to go back and teach it how to handle urllib2 404's too
and then deploy it to the places that want it.

  • QueueStatusServer/handlers/releasepatch.py:
  • Scripts/webkitpy/common/net/buildbot.py:
  • Scripts/webkitpy/common/net/networktransaction.py:
  • Scripts/webkitpy/common/net/statusserver.py:
Location:
trunk/WebKitTools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r70088 r70092  
     12010-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
    1182010-10-19  Eric Seidel  <eric@webkit.org>
    219
  • trunk/WebKitTools/QueueStatusServer/handlers/releasepatch.py

    r70088 r70092  
    5050        attachment = Attachment(attachment_id)
    5151        last_status = attachment.status_for_queue(queue)
    52         if not last_status:
    53             self.error(404)
    54             return
    5552
    5653        # Ideally we should use a transaction for the calls to
     
    5855
    5956        # 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():
    6159            queue.work_items().remove_work_item(attachment_id)
    6260
  • trunk/WebKitTools/Scripts/webkitpy/common/net/buildbot.py

    r69829 r70092  
    109109    def _fetch_revision_to_build_map(self):
    110110        # All _fetch requests go through _buildbot for easier mocking
     111        # FIXME: This should use NetworkTransaction's 404 handling instead.
    111112        try:
    112113            # FIXME: This method is horribly slow due to the huge network load.
     
    218219    def _fetch_results_html(self):
    219220        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.
    221222        try:
    222223            return urllib2.urlopen(results_html)
  • trunk/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py

    r56897 r70092  
    3030import time
    3131
    32 from webkitpy.thirdparty.autoinstalled.mechanize import HTTPError
     32from webkitpy.thirdparty.autoinstalled import mechanize
    3333from webkitpy.common.system.deprecated_logging import log
    3434
     
    4242
    4343class 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):
    4545        self._initial_backoff_seconds = initial_backoff_seconds
    4646        self._grown_factor = grown_factor
     
    5353            try:
    5454                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
    5659                self._check_for_timeout()
    5760                _log.warn("Received HTTP status %s from server.  Retrying in "
  • trunk/WebKitTools/Scripts/webkitpy/common/net/statusserver.py

    r70088 r70092  
    118118    def release_work_item(self, queue_name, patch):
    119119        _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))
    121121
    122122    def update_work_items(self, queue_name, work_items):
     
    133133
    134134    def _fetch_url(self, url):
     135        # FIXME: This should use NetworkTransaction's 404 handling instead.
    135136        try:
    136137            return urllib2.urlopen(url).read()
Note: See TracChangeset for help on using the changeset viewer.