Bug 179395 - [Service Worker] Termination policy
Summary: [Service Worker] Termination policy
Status: RESOLVED DUPLICATE of bug 179401
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-07 14:36 PST by Joseph Pecoraro
Modified: 2017-12-19 15:00 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-11-07 14:36:57 PST
[Service Worker] Termination policy

Service workers don't always get terminated as one would expect.

Steps to Reproduce:
1. Load <https://mdn.github.io/sw-test/>
2. Navigate to <https://webkit.org>
  => Service Workers <https://mdn.github.io/sw-test/sw.js> is still alive

Relatedly, currently just reloading a page with a service worker causes a new service worker to spawn:

Steps to Reproduce:
1. Load <https://mdn.github.io/sw-test/>
2. Reload 3 times
  => Multiple Service Workers exist for <https://mdn.github.io/sw-test/sw.js>

Both cases can result in a large list of Service Workers show up as inspector debug targets, and when there are duplicates it is unclear which is the active worker.
Comment 1 Radar WebKit Bug Importer 2017-11-07 14:37:15 PST
<rdar://problem/35398704>
Comment 2 Joseph Pecoraro 2017-11-07 14:38:33 PST
When a Service Worker has a debugger/inspector attached we should consider not terminating it until the debugger/inspector has disconnected.
Comment 3 Brady Eidson 2017-11-07 16:56:47 PST
Yup, we never terminate. It's an algorithm we need to implement and then use, obviously.

I'll be stubbing out in: https://bugs.webkit.org/show_bug.cgi?id=179401
Comment 4 Geoffrey Garen 2017-12-19 15:00:14 PST

*** This bug has been marked as a duplicate of bug 179401 ***