Bug 197983 - united.com uses 100% of CPU in the service worker process
Summary: united.com uses 100% of CPU in the service worker process
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: Safari 12
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-17 07:09 PDT by Ryosuke Niwa
Modified: 2019-07-30 09:40 PDT (History)
6 users (show)

See Also:


Attachments
sample (158.28 KB, text/plain)
2019-05-17 07:10 PDT, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2019-05-17 07:09:44 PDT
The service worker process of united.com sometimes uses 100% of CPU.
Comment 1 Ryosuke Niwa 2019-05-17 07:10:00 PDT
Created attachment 370115 [details]
sample
Comment 2 Ryosuke Niwa 2019-05-17 07:10:49 PDT
Observed on the system safari shipped with macOS Mojave 18E226
Comment 3 Radar WebKit Bug Importer 2019-05-17 11:24:21 PDT
<rdar://problem/50899544>
Comment 4 Ryosuke Niwa 2019-06-10 13:25:42 PDT
I guess https://bugs.webkit.org/show_bug.cgi?id=196585 mitigated this issue to an extent.
Comment 6 bobik 2019-07-30 04:02:31 PDT
Same with pinterest.com and photos.google.com.

Would be nice if there will be some approval by user like for Geolocation API before the worker installation.
Comment 7 Geoffrey Garen 2019-07-30 09:03:36 PDT
If there were an approval step, what privilege would the user be approving? In this case, I think the privilege was the use of the CPU -- but a webpage already has that privilege (when in the foreground).
Comment 8 bobik 2019-07-30 09:35:16 PDT
Priviledge to run in background (even if webpage is closed)?
Comment 9 youenn fablet 2019-07-30 09:40:51 PDT
(In reply to bobik from comment #8)
> Priviledge to run in background (even if webpage is closed)?

By design, when the last service worker client is closed, the service worker will be stopped. If that is not the case, this is a bug in WebKit implementation.

Ditto for CPU usage, a service worker is not expected to use more CPU than what is allowed for its clients.

Some fixes have been done recently in that area that have shipped in recent Safari Tech Preview.

If you are still seeing such issues, let us know.