[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 13:50:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7fa7554ce3824fc6f8023caf7171c9bf7cadefc2
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 28 02:21:30 2010 +0000

    2010-09-27  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            Patch locks should expire if a patch is marked for retry
            https://bugs.webkit.org/show_bug.cgi?id=46682
    
            This was part Adam's original CommitQueueTask design,
            but support for it was missing from the server.
            I added the support, but triggering lock-release based on this
            special "retry" status feels a bit strange so I added a FIXME.
    
            I also changed the text in queuestatus.html to say "Lock Acquired"
            since "Last Activity" isn't really true.  We only update the lock
            date when the patch is started, not on every status update.
    
            I also noticed an exception in next-patch, which I fixed by re-writing
            the unzip logic in activeworkitems.py again.
    
            * QueueStatusServer/handlers/updatestatus.py:
            * QueueStatusServer/model/activeworkitems.py:
            * QueueStatusServer/templates/queuestatus.html:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68474 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 0670a54..f79ce5a 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,26 @@
+2010-09-27  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Patch locks should expire if a patch is marked for retry
+        https://bugs.webkit.org/show_bug.cgi?id=46682
+
+        This was part Adam's original CommitQueueTask design,
+        but support for it was missing from the server.
+        I added the support, but triggering lock-release based on this
+        special "retry" status feels a bit strange so I added a FIXME.
+
+        I also changed the text in queuestatus.html to say "Lock Acquired"
+        since "Last Activity" isn't really true.  We only update the lock
+        date when the patch is started, not on every status update.
+
+        I also noticed an exception in next-patch, which I fixed by re-writing
+        the unzip logic in activeworkitems.py again.
+
+        * QueueStatusServer/handlers/updatestatus.py:
+        * QueueStatusServer/model/activeworkitems.py:
+        * QueueStatusServer/templates/queuestatus.html:
+
 2010-09-27  Tony Chang  <tony at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebKitTools/QueueStatusServer/handlers/updatestatus.py b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
index 5a93dbd..89858b6 100644
--- a/WebKitTools/QueueStatusServer/handlers/updatestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
@@ -31,6 +31,7 @@ from google.appengine.ext import webapp, db
 from google.appengine.ext.webapp import template
 
 from handlers.updatebase import UpdateBase
+from model.activeworkitems import ActiveWorkItems
 from model.attachment import Attachment
 from model.queuestatus import QueueStatus
 
@@ -56,8 +57,24 @@ class UpdateStatus(UpdateBase):
         queue_status.results_file = db.Blob(str(results_file))
         return queue_status
 
+    @staticmethod
+    def _expire_item(key, item_id):
+        active_work_items = db.get(key)
+        active_work_items.expire_item(item_id)
+        active_work_items.put()
+
+    # FIXME: An explicit lock_release request would be cleaner than this magical "Retry" status.
+    def _update_active_work_items(self, queue_status):
+        if queue_status.message != "Retry":  # From AbstractQueue._retry_status
+            return
+        active_items = ActiveWorkItems.all().filter("queue_name =", queue_status.queue_name).get()
+        if not active_items:
+            return
+        return db.run_in_transaction(self._expire_item, active_items.key(), queue_status.active_patch_id)
+
     def post(self):
         queue_status = self._queue_status_from_request()
         queue_status.put()
+        self._update_active_work_items(queue_status)
         Attachment.dirty(queue_status.active_patch_id)
         self.response.out.write(queue_status.key().id())
diff --git a/WebKitTools/QueueStatusServer/model/activeworkitems.py b/WebKitTools/QueueStatusServer/model/activeworkitems.py
index 3999c92..496f900 100644
--- a/WebKitTools/QueueStatusServer/model/activeworkitems.py
+++ b/WebKitTools/QueueStatusServer/model/activeworkitems.py
@@ -43,16 +43,21 @@ class ActiveWorkItems(db.Model):
         return zip(self.item_ids, self.item_dates)
 
     def _set_item_time_pairs(self, pairs):
-        if not pairs:
-            self.item_ids = []
-            self.item_dates = []
-            return
-        self.item_ids, self.item_dates = zip(*pairs)
+        if pairs:
+            # The * operator raises on an empty list.
+            # db.Model does not tuples, we have to make lists.
+            self.item_ids, self.item_dates = map(list, zip(*pairs))
+        else:
+            self.item_ids = self.item_dates = []
 
     def _append_item_time_pair(self, pair):
         self.item_ids.append(pair[0])
         self.item_dates.append(pair[1])
 
+    def expire_item(self, item_id):
+        nonexpired_pairs = [pair for pair in self._item_time_pairs() if pair[0] != item_id]
+        self._set_item_time_pairs(nonexpired_pairs)
+
     def deactivate_expired(self, now):
         one_hour_ago = time.mktime((now - timedelta(minutes=60)).timetuple())
         nonexpired_pairs = [pair for pair in self._item_time_pairs() if pair[1] > one_hour_ago]
diff --git a/WebKitTools/QueueStatusServer/templates/queuestatus.html b/WebKitTools/QueueStatusServer/templates/queuestatus.html
index fbcdfeb..1b98952 100644
--- a/WebKitTools/QueueStatusServer/templates/queuestatus.html
+++ b/WebKitTools/QueueStatusServer/templates/queuestatus.html
@@ -42,7 +42,7 @@
 
 <h3>Patches in queue</h3>
 <table>
-    <tr><th>Position</th><th>Patch</th><th>Last Activity</th></tr>
+    <tr><th>Position</th><th>Patch</th><th>Lock Acquired</th></tr>
     {% for row in work_item_rows %}
     <tr>
         <td>#{{ forloop.counter }}</td>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list