[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric at webkit.org eric at webkit.org
Wed Dec 22 14:46:26 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5d4f26622c8e937ba12381599d12e7ff8f7a162d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 19 22:06:52 2010 +0000

    2010-10-19  Eric Seidel  <eric at 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:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c116807..782d9c0 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,22 @@
 2010-10-19  Eric Seidel  <eric at 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:
+
+2010-10-19  Eric Seidel  <eric at webkit.org>
+
         Unreviewed.  Fixing typos in my previous commit.
 
         Make patch release explicit and not a magic part of "retry" status
diff --git a/WebKitTools/QueueStatusServer/handlers/releasepatch.py b/WebKitTools/QueueStatusServer/handlers/releasepatch.py
index a6a7175..0e46e69 100644
--- a/WebKitTools/QueueStatusServer/handlers/releasepatch.py
+++ b/WebKitTools/QueueStatusServer/handlers/releasepatch.py
@@ -49,15 +49,13 @@ class ReleasePatch(UpdateBase):
         attachment_id = self._int_from_request("attachment_id")
         attachment = Attachment(attachment_id)
         last_status = attachment.status_for_queue(queue)
-        if not last_status:
-            self.error(404)
-            return
 
         # Ideally we should use a transaction for the calls to
         # WorkItems and ActiveWorkItems.
 
         # Only remove it from the queue if the last message is not a retry request.
-        if not last_status.is_retry_request():
+        # Allow removing it from the queue even if there is no last_status for easier testing.
+        if not last_status or not last_status.is_retry_request():
             queue.work_items().remove_work_item(attachment_id)
 
         # Always release the lock on the item.
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
index d3d08ee..a14bc7f 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
@@ -108,6 +108,7 @@ class Builder(object):
 
     def _fetch_revision_to_build_map(self):
         # All _fetch requests go through _buildbot for easier mocking
+        # FIXME: This should use NetworkTransaction's 404 handling instead.
         try:
             # FIXME: This method is horribly slow due to the huge network load.
             # FIXME: This is a poor way to do revision -> build mapping.
@@ -217,7 +218,7 @@ class Build(object):
 
     def _fetch_results_html(self):
         results_html = "%s/results.html" % (self.results_url())
-        # FIXME: We need to move this sort of 404 logic into NetworkTransaction or similar.
+        # FIXME: This should use NetworkTransaction's 404 handling instead.
         try:
             return urllib2.urlopen(results_html)
         except urllib2.HTTPError, error:
diff --git a/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
index c82fc6f..04c158f 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
@@ -29,7 +29,7 @@
 import logging
 import time
 
-from webkitpy.thirdparty.autoinstalled.mechanize import HTTPError
+from webkitpy.thirdparty.autoinstalled import mechanize
 from webkitpy.common.system.deprecated_logging import log
 
 
@@ -41,7 +41,7 @@ class NetworkTimeout(Exception):
 
 
 class NetworkTransaction(object):
-    def __init__(self, initial_backoff_seconds=10, grown_factor=1.5, timeout_seconds=10*60):
+    def __init__(self, initial_backoff_seconds=10, grown_factor=1.5, timeout_seconds=(10 * 60), convert_404_to_None=False):
         self._initial_backoff_seconds = initial_backoff_seconds
         self._grown_factor = grown_factor
         self._timeout_seconds = timeout_seconds
@@ -52,7 +52,10 @@ class NetworkTransaction(object):
         while True:
             try:
                 return request()
-            except HTTPError, e:
+            # FIXME: We should catch urllib2.HTTPError here too.
+            except mechanize.HTTPError, e:
+                if convert_404_to_None and e.code == 404:
+                    return None
                 self._check_for_timeout()
                 _log.warn("Received HTTP status %s from server.  Retrying in "
                           "%s seconds..." % (e.code, self._backoff_seconds))
diff --git a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
index bccdbd1..b6eb01e 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
@@ -117,7 +117,7 @@ class StatusServer:
 
     def release_work_item(self, queue_name, patch):
         _log.debug("Releasing work item %s from %s" % (patch.id(), queue_name))
-        return NetworkTransaction().run(lambda: self._post_release_work_item(queue_name, patch))
+        return NetworkTransaction(convert_404_to_None=True).run(lambda: self._post_release_work_item(queue_name, patch))
 
     def update_work_items(self, queue_name, work_items):
         _log.debug("Recording work items: %s for %s" % (work_items, queue_name))
@@ -132,6 +132,7 @@ class StatusServer:
         return NetworkTransaction().run(lambda: self._post_svn_revision_to_server(svn_revision_number, broken_bot))
 
     def _fetch_url(self, url):
+        # FIXME: This should use NetworkTransaction's 404 handling instead.
         try:
             return urllib2.urlopen(url).read()
         except urllib2.HTTPError, e:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list