[Webkit-unassigned] [Bug 159827] run-webkit-tests should trigger a spindump when WebContent process is unresponsive

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 2 13:09:23 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=159827

--- Comment #51 from Daniel Bates <dbates at webkit.org> ---
(In reply to comment #50)
> Comment on attachment 285120 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=285120&action=review
> 
> >> Tools/Scripts/webkitpy/port/ios.py:423
> >> +            ], return_exit_code=True)
> > 
> > Notice that Executive.run_command() only throws a ScriptError exception if return_exit_code := False. It is good programming practice to limit the scope of a try-except to the minimum code that can raise an exception to help make it straightforward to debug the cause of an exception. In comment #25 I gave an example of one way we can write this code such that we limit the scope of the try-except block.
> 
> This perhaps brings up another question, then, about sample_file_path(...),
> which calls filesystem.join(...).  In the original sample_process code,
> finding the report was in the try catch block, which is why I kept it there
> after adding spindump.  If filesystem.join(...) throws an exception (or
> results_directory(), actually), what is our desired functionality? 

Filesystem.join() does not raise an exception because it turns around and calls os.path.join(). And I do not expect os.path.join() to raise an exception because its documentation, <https://docs.python.org/2/library/os.path.html>, as of 08/02 makes no mention that it raises an exception.

> I think for the time being, keeping the generation of the hang_report file path
> inside the try-except block is prudent

Notice that the try-except block only catches a webkitpy.common.system.executive.ScriptError exception. That is, it does not catch a general-purpose Python Exception.

> , as the tests can continue if an
> error happens while attempting to generate either version of the crash
> report, and 

> it would seem unhelpful to be to have two try-except blocks in
> this function. 
> 

How did you come to the conclusion that we need to try-except blocks in this function? Notice that I have exactly one try-except block in the example I gave in comment #25.

As aforementioned above, the try-except block in sample_process() only catches a webkitpy.common.system.executive.ScriptError exception. The current code allows any other exception to bubble up. Maybe we should revise this code to be more resilient to other kinds of exceptions. If so, such consideration and work is more appropriate in a separate bug as the focus of this bug is to add an enhancement to our sampling machinery: use spindump if we can.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160802/c6a85245/attachment-0001.html>


More information about the webkit-unassigned mailing list