Bug 230016 - Remove responsiveness timer in NetworkProcessProxy::getNetworkProcessConnection
Summary: Remove responsiveness timer in NetworkProcessProxy::getNetworkProcessConnection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-07 12:44 PDT by Sihui Liu
Modified: 2021-09-08 14:56 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.45 KB, patch)
2021-09-07 12:51 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (4.28 KB, patch)
2021-09-07 13:40 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (4.26 KB, patch)
2021-09-08 14:23 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2021-09-07 12:44:54 PDT
...
Comment 1 Sihui Liu 2021-09-07 12:51:43 PDT
Created attachment 437543 [details]
Patch
Comment 2 Chris Dumez 2021-09-07 13:06:15 PDT
Comment on attachment 437543 [details]
Patch

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

> Source/WebKit/ChangeLog:9
> +        responsiveness timer in NetworkProcessProxy::getNetworkProcessConnection, blocked netowrk process will be killed

typo: netowrk

> Source/WebKit/ChangeLog:10
> +        and a new network process will be launched for getting connection. However, the new network process may stuck

"may get stuck"

> Source/WebKit/ChangeLog:11
> +        in initializeNetworkProcess too. In this case, web process will crash for not able to get network process 

"for not being able"

> Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:-253
> -    startResponsivenessTimer(UseLazyStop::No);

What if we have a hung network process? Now we won't recover.

This patch is a revert of https://bugs.webkit.org/show_bug.cgi?id=226994 without trying to resolve the problem https://bugs.webkit.org/show_bug.cgi?id=226994 was addressing.
Comment 3 Chris Dumez 2021-09-07 13:10:32 PDT
Comment on attachment 437543 [details]
Patch

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

>> Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:-253
>> -    startResponsivenessTimer(UseLazyStop::No);
> 
> What if we have a hung network process? Now we won't recover.
> 
> This patch is a revert of https://bugs.webkit.org/show_bug.cgi?id=226994 without trying to resolve the problem https://bugs.webkit.org/show_bug.cgi?id=226994 was addressing.

Maybe we only want to start the responsiveness timer if state() == Running to avoid starting it in the "process launch" case. That said, if the process hangs on launch, I believe we want and try to recover too so it would not be great.

Alternatively, we can use a longer responsiveness timer if we believe the process may take more than 3 seconds to launch but still eventually complete launching. It's hard to tell without data but dropping hang detection completely seems wrong.
Comment 4 Sihui Liu 2021-09-07 13:35:46 PDT
(In reply to Chris Dumez from comment #3)
> Comment on attachment 437543 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437543&action=review
> 
> >> Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:-253
> >> -    startResponsivenessTimer(UseLazyStop::No);
> > 
> > What if we have a hung network process? Now we won't recover.
> > 
> > This patch is a revert of https://bugs.webkit.org/show_bug.cgi?id=226994 without trying to resolve the problem https://bugs.webkit.org/show_bug.cgi?id=226994 was addressing.
> 
> Maybe we only want to start the responsiveness timer if state() == Running
> to avoid starting it in the "process launch" case. That said, if the process
> hangs on launch, I believe we want and try to recover too so it would not be
> great.

Hmm but state() == Running does not mean process does not hang. In this case network process is processing initializeNetowrkProcess message.
One problem for killing network process when it hangs is we won't know why it hangs. 

> 
> Alternatively, we can use a longer responsiveness timer if we believe the
> process may take more than 3 seconds to launch but still eventually complete
> launching. It's hard to tell without data but dropping hang detection
> completely seems wrong.

According to rdar://78729329(or rdar://78636467), the hang can be very long, which is a bug but may not get fixed soon.
Comment 5 Sihui Liu 2021-09-07 13:40:24 PDT
Created attachment 437553 [details]
Patch
Comment 6 Sihui Liu 2021-09-08 14:08:08 PDT
rdar://80760179
Comment 7 Sihui Liu 2021-09-08 14:23:06 PDT
Created attachment 437665 [details]
Patch for landing
Comment 8 EWS 2021-09-08 14:56:27 PDT
Committed r282174 (241466@main): <https://commits.webkit.org/241466@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437665 [details].