Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceWorker: don't leak service worker managers #26107

Open
gterzian opened this issue Apr 4, 2020 · 2 comments
Open

ServiceWorker: don't leak service worker managers #26107

gterzian opened this issue Apr 4, 2020 · 2 comments

Comments

@gterzian
Copy link
Member

@gterzian gterzian commented Apr 4, 2020

Follow-up on #26087

So in the PR a ServiceWorkerManager is created when a worker is first registered for a given origin, see https://github.com/servo/servo/pull/26087/files#diff-55c92a6a5ba7654ce45fe6fc6c63740fR2629

We only shut those down when the constellation shuts-down. https://github.com/servo/servo/pull/26087/files#diff-55c92a6a5ba7654ce45fe6fc6c63740fR2792

We could also shut them down earlier, so as to not effectively leak them unless they are actually being useful in some way.

It's not completely clear what the right heuristics for that would be, but the spec offers some guidance: https://w3c.github.io/ServiceWorker/#service-worker-lifetime

@CYBAI
Copy link
Collaborator

@CYBAI CYBAI commented May 27, 2020

I'd like to try to work on this one 🙋‍♂️

Will try to read the spec first and see how we can handle it.

@CYBAI CYBAI self-assigned this May 27, 2020
@gterzian
Copy link
Member Author

@gterzian gterzian commented May 30, 2020

In the initial issue I linked to the lifetime of service workers, and I think it's actually more relevant to link to the lifetime of registrations at https://w3c.github.io/ServiceWorker/#service-worker-registration-lifetime.

So it looks to me that if we were to shutdown the manager process for an origin, we would then still need to persists the registrations for that origin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.