Changeset 52242 in webkit


Ignore:
Timestamp:
Dec 17, 2009 12:27:25 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2009-12-17 Adam Barth <abarth@webkit.org>

Rubber stamp by Seidel.

Clean up exception handling in WorkQueue. Basically, a bunch of the
delegate messages can throw exceptions because of network errors. We
want the queues to keep on ticking instead of erroring out. That means
we want to catch generic exceptions and continue looping.

Also, cleaned up the exception handling in the EWS to properly log
failures.

  • Scripts/modules/commands/early_warning_system.py:
  • Scripts/modules/commands/queues.py:
  • Scripts/modules/workqueue.py:
Location:
trunk/WebKitTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r52241 r52242  
     12009-12-17  Adam Barth  <abarth@webkit.org>
     2
     3        Rubber stamp by Seidel.
     4
     5        Clean up exception handling in WorkQueue.  Basically, a bunch of the
     6        delegate messages can throw exceptions because of network errors.  We
     7        want the queues to keep on ticking instead of erroring out.  That means
     8        we want to catch generic exceptions and continue looping.
     9
     10        Also, cleaned up the exception handling in the EWS to properly log
     11        failures.
     12
     13        * Scripts/modules/commands/early_warning_system.py:
     14        * Scripts/modules/commands/queues.py:
     15        * Scripts/modules/workqueue.py:
     16
    1172009-12-16  Adam Barth  <abarth@webkit.org>
    218
  • trunk/WebKitTools/Scripts/modules/commands/early_warning_system.py

    r52240 r52242  
    4646            self._update_status("Unable to perform a build.")
    4747            return False
    48         self._update_status("Building patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch)
    4948        return True
    5049
    5150    def process_work_item(self, patch):
    52         self.run_bugzilla_tool([
    53             "build-attachment",
    54             self.port.flag(),
    55             "--force-clean",
    56             "--quiet",
    57             "--non-interactive",
    58             "--parent-command=%s" % self.name,
    59             "--no-update",
    60             patch["id"]])
    61         self._patches.did_pass(patch)
     51        try:
     52            self.run_bugzilla_tool([
     53                "build-attachment",
     54                self.port.flag(),
     55                "--force-clean",
     56                "--quiet",
     57                "--non-interactive",
     58                "--parent-command=%s" % self.name,
     59                "--no-update",
     60                patch["id"]])
     61            self._patches.did_pass(patch)
     62        except ScriptError, e:
     63            self._patches.did_fail(patch)
     64            raise e
    6265
    6366    @classmethod
     
    6972        status_id = tool.status_bot.update_status(cls.name, "patch %s failed: %s" % (patch["id"], script_error.message), patch, StringIO(script_error.output))
    7073        results_link = tool.status_bot.results_url_for_status(status_id)
    71         message = "Attachment %s did not build on %s:\nFull output: %s" % (patch["id"], cls.port_name, results_link)
     74        message = "Attachment %s did not build on %s:\nBuild output: %s" % (patch["id"], cls.port_name, results_link)
    7275        tool.bugs.post_comment_to_bug(patch["bug_id"], message, cc=cls.watchers)
    7376
  • trunk/WebKitTools/Scripts/modules/commands/queues.py

    r52238 r52242  
    184184        if patch_id:
    185185            return self.tool.bugs.fetch_attachment(patch_id)
     186        self._update_status("Empty queue.")
    186187
    187188    def should_proceed_with_work_item(self, patch):
  • trunk/WebKitTools/Scripts/modules/workqueue.py

    r52145 r52242  
    9191        self._delegate.begin_work_queue()
    9292        while (self._delegate.should_continue_work_queue()):
    93             self._ensure_work_log_closed()
    9493            try:
     94                self._ensure_work_log_closed()
    9595                work_item = self._delegate.next_work_item()
    9696                if not work_item:
     
    100100                    self._sleep("Not proceeding with work item.")
    101101                    continue
     102
     103                # FIXME: Work logs should not depend on bug_id specificaly.
     104                #        This looks fixed, no?
     105                self._open_work_log(work_item)
     106                try:
     107                    self._delegate.process_work_item(work_item)
     108                except ScriptError, e:
     109                    # Use a special exit code to indicate that the error was already
     110                    # handled in the child process and we should just keep looping.
     111                    if e.exit_code == self.handled_error_code:
     112                        continue
     113                    message = "Unexpected failure when landing patch!  Please file a bug against bugzilla-tool.\n%s" % e.message_with_output()
     114                    self._delegate.handle_unexpected_error(work_item, message)
    102115            except KeyboardInterrupt, e:
    103116                log("\nUser terminated queue.")
     
    107120                # Don't try tell the status bot, in case telling it causes an exception.
    108121                self._sleep("Exception while preparing queue: %s." % e)
    109                 continue
    110 
    111             # FIXME: Work logs should not depend on bug_id specificaly.
    112             self._open_work_log(work_item)
    113             try:
    114                 self._delegate.process_work_item(work_item)
    115             except ScriptError, e:
    116                 # Use a special exit code to indicate that the error was already
    117                 # handled in the child process and we should just keep looping.
    118                 if e.exit_code == self.handled_error_code:
    119                     continue
    120                 message = "Unexpected failure when landing patch!  Please file a bug against bugzilla-tool.\n%s" % e.message_with_output()
    121                 self._delegate.handle_unexpected_error(work_item, message)
    122122        # Never reached.
    123123        self._ensure_work_log_closed()
Note: See TracChangeset for help on using the changeset viewer.