Bug 179395

Summary: [Service Worker] Termination policy
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: beidson, cdumez, ggaren, joepeck, olivier, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=174541

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 ***