Bug 233001 - WebKit is unable to recover if a WebProcess gets terminated while it is launching
Summary: WebKit is unable to recover if a WebProcess gets terminated while it is launc...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-11 09:42 PST by Chris Dumez
Modified: 2021-11-12 08:26 PST (History)
5 users (show)

See Also:


Attachments
Patch (5.60 KB, patch)
2021-11-11 09:50 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (7.75 KB, patch)
2021-11-11 10:42 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (7.37 KB, patch)
2021-11-11 17:20 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-11-11 09:42:10 PST
WebKit is unable to recover if a WebProcess gets terminated while it is launching.
Comment 1 Chris Dumez 2021-11-11 09:42:23 PST
<rdar://85302938>
Comment 2 Chris Dumez 2021-11-11 09:50:33 PST
Created attachment 443960 [details]
Patch
Comment 3 Brent Fulgham 2021-11-11 10:24:23 PST
Comment on attachment 443960 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=443960&action=review

r=me

> Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm:326
> +        didFinishLaunchingProcess(0, IPC::Connection::Identifier());

It seems like it might be clearer if there was a method "didFailToLaunch" or something that could call "didFinishLaunchingProcess" with the right arguments, but also log something helpful to the console.
Comment 4 Chris Dumez 2021-11-11 10:42:36 PST
Created attachment 443972 [details]
Patch
Comment 5 Chris Dumez 2021-11-11 17:20:13 PST
Created attachment 444028 [details]
Patch
Comment 6 Chris Dumez 2021-11-12 07:24:18 PST
Comment on attachment 444028 [details]
Patch

Requesting review again. I had to change the approach a little bit to address an API test failure.
Comment 7 Brent Fulgham 2021-11-12 08:08:33 PST
Comment on attachment 444028 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=444028&action=review

r=me

> Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm:325
> +        terminateXPCConnection();

It's a little surprising that this is only an issue on macOS; do we not have a similar issue with our termination logic on iOS?
Comment 8 Chris Dumez 2021-11-12 08:09:30 PST
(In reply to Brent Fulgham from comment #7)
> Comment on attachment 444028 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=444028&action=review
> 
> r=me
> 
> > Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm:325
> > +        terminateXPCConnection();
> 
> It's a little surprising that this is only an issue on macOS; do we not have
> a similar issue with our termination logic on iOS?

The issue is for both Mac and iOS. This file is used by both and it merely badly named. I'll replace Mac with Cocoa in a follow-up for clarity.
Comment 9 Brent Fulgham 2021-11-12 08:15:03 PST
Comment on attachment 444028 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=444028&action=review

>>> Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm:325
>>> +        terminateXPCConnection();
>> 
>> It's a little surprising that this is only an issue on macOS; do we not have a similar issue with our termination logic on iOS?
> 
> The issue is for both Mac and iOS. This file is used by both and it merely badly named. I'll replace Mac with Cocoa in a follow-up for clarity.

Oh, wow! Yes -- please do! :-)
Comment 10 Chris Dumez 2021-11-12 08:18:59 PST
Comment on attachment 444028 [details]
Patch

Clearing flags on attachment: 444028

Committed r285720 (244179@main): <https://commits.webkit.org/244179@main>
Comment 11 Chris Dumez 2021-11-12 08:19:02 PST
All reviewed patches have been landed.  Closing bug.