Bug 214383 - [WinCairo][CURL] NetworkProcess consumes CPU resource greedily.
Summary: [WinCairo][CURL] NetworkProcess consumes CPU resource greedily.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-15 16:38 PDT by Takashi Komori
Modified: 2021-08-02 13:47 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.68 KB, patch)
2020-07-16 00:35 PDT, Takashi Komori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Komori 2020-07-15 16:38:32 PDT
When MiniBrowser for wincairo accesses a sites, it sometimes consumes CPU greedily.

How to reproduce.
1) Access http://news.yahoo.co.jp/ with MiniBrowser for wincairo.
2) Reload the page.
3) Check task-manager, you will see NetworkProcess consumes much CPU resource.
Comment 1 Takashi Komori 2020-07-16 00:12:19 PDT
The cause of this issue is that CurlRequestSchduler::workerThread doesn't stop/sleep at ::select.
When WebKit gets response headers the CurlRequest makes the curl_easy_handle PAUSED.
We do not have to check paused handles by ::select but they are watched.
And if a handle is ready for read/write ::select goes through without any wait.
This makes worker thread busy loop.

The root cause is NetworkDataTaskCurl::invokeDidReceiveResponse() doesn't handle PolicyAction::Ignore properly, and active jobs in CurlRequestSceduler aren't removed until timeout.
So we have to call invalidateAndCancel() when policy action is Ignore.
Comment 2 Takashi Komori 2020-07-16 00:35:23 PDT
Created attachment 404427 [details]
Patch
Comment 3 EWS 2020-07-16 16:35:26 PDT
Committed r264485: <https://trac.webkit.org/changeset/264485>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404427 [details].
Comment 4 Radar WebKit Bug Importer 2020-07-16 16:36:18 PDT
<rdar://problem/65695976>