RESOLVED FIXED 179552
Call "Terminate Service Worker" on all workers when all their clients are gone
https://bugs.webkit.org/show_bug.cgi?id=179552
Summary Call "Terminate Service Worker" on all workers when all their clients are gone
Brady Eidson
Reported 2017-11-10 15:08:47 PST
Consider calling "Terminate Service Worker" when WebProcesses go away
Attachments
Patch (5.81 KB, patch)
2017-12-02 18:31 PST, youenn fablet
no flags
Patch (1.36 KB, patch)
2017-12-05 11:04 PST, youenn fablet
no flags
Brady Eidson
Comment 1 2017-11-16 12:50:09 PST
Rename for the simplicity of this patch: Consider calling "Terminate Service Worker" on all workers when all WebProcesses go away
youenn fablet
Comment 2 2017-12-02 18:31:21 PST
WebKit Commit Bot
Comment 3 2017-12-04 12:35:09 PST
Comment on attachment 328272 [details] Patch Clearing flags on attachment: 328272 Committed r225486: <https://trac.webkit.org/changeset/225486>
WebKit Commit Bot
Comment 4 2017-12-04 12:35:10 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 5 2017-12-04 12:37:30 PST
Geoffrey Garen
Comment 6 2017-12-04 13:43:33 PST
Comment on attachment 328272 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328272&action=review > Source/WebCore/workers/service/server/SWServer.cpp:55 > +static Seconds terminationDelay { 60_s }; I think we can make this value a lot smaller. Starting a worker is less expensive than loading one or more webpages. So, if the user unloads the last page from a given origin, we really aren't that concerned about having to restart the origin's worker later. I'd suggest something like 5s.
youenn fablet
Comment 7 2017-12-04 14:02:48 PST
(In reply to Geoffrey Garen from comment #6) > Comment on attachment 328272 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=328272&action=review > > > Source/WebCore/workers/service/server/SWServer.cpp:55 > > +static Seconds terminationDelay { 60_s }; > > I think we can make this value a lot smaller. > > Starting a worker is less expensive than loading one or more webpages. So, > if the user unloads the last page from a given origin, we really aren't that > concerned about having to restart the origin's worker later. > > I'd suggest something like 5s. Maybe 60 is too big indeed, especially if we add another timer to quit the service worker process when there is no longer any running service worker. That said, we might need some measurements on how much time it will take for a service worker to run and be ready to process fetch events as this may impact page load time.
youenn fablet
Comment 8 2017-12-05 11:04:43 PST
Reopening to attach new patch.
youenn fablet
Comment 9 2017-12-05 11:04:43 PST
youenn fablet
Comment 10 2017-12-05 11:05:13 PST
(In reply to youenn fablet from comment #9) > Created attachment 328474 [details] > Patch Reducing from 60_s to 10_s for now.
WebKit Commit Bot
Comment 11 2017-12-05 13:24:39 PST
Comment on attachment 328474 [details] Patch Clearing flags on attachment: 328474 Committed r225533: <https://trac.webkit.org/changeset/225533>
WebKit Commit Bot
Comment 12 2017-12-05 13:24:41 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.