RESOLVED FIXED62614
rwt: handle worker exceptions cleanly
https://bugs.webkit.org/show_bug.cgi?id=62614
Summary rwt: handle worker exceptions cleanly
Dirk Pranke
Reported 2011-06-13 17:36:11 PDT
rwt: handle worker exceptions cleanly
Attachments
Patch (8.46 KB, patch)
2011-06-13 17:53 PDT, Dirk Pranke
no flags
update w/ review feedback from tony (8.46 KB, patch)
2011-06-14 13:20 PDT, Dirk Pranke
tony: review+
Dirk Pranke
Comment 1 2011-06-13 17:53:09 PDT
WebKit Review Bot
Comment 2 2011-06-13 17:56:19 PDT
Attachment 97049 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/Scripts/webkitpy..." exit_code: 1 Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:1323: deprecated form of raising exception [pep8/W602] [5] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dirk Pranke
Comment 3 2011-06-13 17:58:48 PDT
Comment on attachment 97049 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=97049&action=review >> Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:1323 >> + raise exception_type, exception_value > > deprecated form of raising exception [pep8/W602] [5] The code is correct, and I don't know if there's a way to suppress this warning given whatever lint tool we're using, or if there's another way to re-raise this error, but otherwise this warning can be ignored, I think.
Tony Chang
Comment 4 2011-06-14 09:40:28 PDT
Comment on attachment 97049 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=97049&action=review > Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:695 > + except WorkerException, e: Nit: e looks unused, maybe remove it or re-raise it? > Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:702 > raise Should we re-raise the exception here too? >>> Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:1323 >>> + raise exception_type, exception_value >> >> deprecated form of raising exception [pep8/W602] [5] > > The code is correct, and I don't know if there's a way to suppress this warning given whatever lint tool we're using, or if there's another way to re-raise this error, but otherwise this warning can be ignored, I think. Can you do raise exception_type(exception_value) or does that not always work? > Tools/Scripts/webkitpy/layout_tests/layout_package/worker.py:108 > _log.debug("%s done with message loop%s" % (self._name, exception_msg)) Nit: Should the prefix ", " be moved into this log message and removed from exception_msg?
Dirk Pranke
Comment 5 2011-06-14 13:19:29 PDT
(In reply to comment #4) > (From update of attachment 97049 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=97049&action=review > > > Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:695 > > + except WorkerException, e: > > Nit: e looks unused, maybe remove it or re-raise it? > I've removed the "e". > > Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:702 > > raise > > Should we re-raise the exception here too? > I'm confused, what do you mean. Doesn't "raise" by itself re-raise the exception? > >>> Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:1323 > >>> + raise exception_type, exception_value > >> > >> deprecated form of raising exception [pep8/W602] [5] > > > > The code is correct, and I don't know if there's a way to suppress this warning given whatever lint tool we're using, or if there's another way to re-raise this error, but otherwise this warning can be ignored, I think. > > Can you do raise exception_type(exception_value) or does that not always work? That seems to work, and doesn't get a complaint from lint. Fortunately, there's no traceback. > > > Tools/Scripts/webkitpy/layout_tests/layout_package/worker.py:108 > > _log.debug("%s done with message loop%s" % (self._name, exception_msg)) > > Nit: Should the prefix ", " be moved into this log message and removed from exception_msg? No, because exception_msg is empty if there's no exception, and we would be left with a comma but nothing following it.
Dirk Pranke
Comment 6 2011-06-14 13:20:33 PDT
Created attachment 97161 [details] update w/ review feedback from tony
Tony Chang
Comment 7 2011-06-14 13:30:04 PDT
Comment on attachment 97161 [details] update w/ review feedback from tony View in context: https://bugs.webkit.org/attachment.cgi?id=97161&action=review > Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py:702 > raise Yes, you're right, this gives the right behavior. I was confused. If you were to raise e, the caught exception, it would lose the stack.
Dirk Pranke
Comment 8 2011-06-14 13:37:08 PDT
Note You need to log in before you can comment on or make changes to this bug.