Changeset 128899 in webkit


Ignore:
Timestamp:
Sep 18, 2012 8:30:27 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

EWS shouldn't sleep if there are new patches in its queue
https://bugs.webkit.org/show_bug.cgi?id=83038

Patch by Szilard Ledan <Szilárd LEDÁN> on 2012-09-18
Reviewed by Eric Seidel.

EWS tries to process a security patch. Of course it can't, because the EWS isn't
the member of the security group. But the problem is that after it can't process
the attachment, it says that queue is empty (but it isn't!) and it sleeps 2 minutes
and push the security patch to the end of the queue.
Now it stays in the loop until it finds a patch or the queue gets empty.

  • Scripts/webkitpy/tool/commands/queues.py:

(AbstractPatchQueue._next_patch):

  • Scripts/webkitpy/tool/commands/queues_unittest.py:

(AbstractPatchQueueTest.test_next_patch):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r128895 r128899  
     12012-09-18  Szilard Ledan  <szledan@inf.u-szeged.hu>
     2
     3        EWS shouldn't sleep if there are new patches in its queue
     4        https://bugs.webkit.org/show_bug.cgi?id=83038
     5
     6        Reviewed by Eric Seidel.
     7
     8        EWS tries to process a security patch. Of course it can't, because the EWS isn't
     9        the member of the security group. But the problem is that after it can't process
     10        the attachment, it says that queue is empty (but it isn't!) and it sleeps 2 minutes
     11        and push the security patch to the end of the queue.
     12        Now it stays in the loop until it finds a patch or the queue gets empty.
     13
     14        * Scripts/webkitpy/tool/commands/queues.py:
     15        (AbstractPatchQueue._next_patch):
     16        * Scripts/webkitpy/tool/commands/queues_unittest.py:
     17        (AbstractPatchQueueTest.test_next_patch):
     18
    1192012-09-18  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    220
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues.py

    r126185 r128899  
    202202
    203203    def _next_patch(self):
    204         patch_id = self._tool.status_server.next_work_item(self.name)
    205         if not patch_id:
    206             return None
    207         patch = self._tool.bugs.fetch_attachment(patch_id)
    208         if not patch:
    209             # FIXME: Using a fake patch because release_work_item has the wrong API.
    210             # We also don't really need to release the lock (although that's fine),
    211             # mostly we just need to remove this bogus patch from our queue.
    212             # If for some reason bugzilla is just down, then it will be re-fed later.
    213             patch = Attachment({'id': patch_id}, None)
    214             self._release_work_item(patch)
    215             return None
     204        # FIXME: Bugzilla accessibility should be checked here; if it's unaccessible,
     205        # it should return None.
     206        patch = None
     207        while not patch:
     208            patch_id = self._tool.status_server.next_work_item(self.name)
     209            if not patch_id:
     210                return None
     211            patch = self._tool.bugs.fetch_attachment(patch_id)
     212            if not patch:
     213                # FIXME: Using a fake patch because release_work_item has the wrong API.
     214                # We also don't really need to release the lock (although that's fine),
     215                # mostly we just need to remove this bogus patch from our queue.
     216                # If for some reason bugzilla is just down, then it will be re-fed later.
     217                fake_patch = Attachment({'id': patch_id}, None)
     218                self._release_work_item(fake_patch)
    216219        return patch
    217220
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py

    r126185 r128899  
    159159        queue._options.port = None
    160160        self.assertEquals(queue._next_patch(), None)
    161         tool.status_server = MockStatusServer(work_items=[2, 10000])
     161        tool.status_server = MockStatusServer(work_items=[2, 10000, 10001])
    162162        expected_stdout = "MOCK: fetch_attachment: 2 is not a known attachment id\n"  # A mock-only message to prevent us from making mistakes.
    163163        expected_stderr = "MOCK: release_work_item: None 2\n"
    164         patch_id = OutputCapture().assert_outputs(self, queue._next_patch, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
    165         self.assertEquals(patch_id, None)  # 2 is an invalid patch id
    166         self.assertEquals(queue._next_patch().id(), 10000)
     164        patch = OutputCapture().assert_outputs(self, queue._next_patch, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
     165        # The patch.id() == 2 is ignored because it doesn't exist.
     166        self.assertEquals(patch.id(), 10000)
     167        self.assertEquals(queue._next_patch().id(), 10001)
     168        self.assertEquals(queue._next_patch(), None)    # When the queue is empty
    167169
    168170    def test_upload_results_archive_for_patch(self):
Note: See TracChangeset for help on using the changeset viewer.