New issue
Advanced search Search tips

Issue 849539 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 845341



Sign in to add a comment

Ensure ServiceWorkerVersion is alive until shutdown completes

Project Member Reported by shimazu@chromium.org, Jun 5 2018

Issue description

ServiceWorkerProviderHost for controller is now having the ownership of ServiceWorkerVersion. However, during worker shutdown, if the error handler of mojom::SWContainerHost is triggered before mojom::EmbeddedWorkerInstanceHost::OnStopped(), SWProviderHost will be removed before getting the OnStopped() message. We are now reporting it as ABORT.

We used to deal with the issue by associating pipes for mojom::EWInstanceClient and mojom::SWContainerHost together at  crbug.com/676526 , but now that behavior blocks having a dedicated pipe for mojom::SWContainerHost.
We need to ensure SWVersion is kept alive during its shutdown properly.
 
I'm now imagining that having the ownership of SWVersion by itself during stopping, and release it when 
1) SWVersion gets OnStopped() message (= SWVersion::OnStopped())
2) SWVersion gets the error handler of EWInstance (= SWVersion::OnDetached())

But it seems a bit scary since it may cause memory leak. We may need further investigation.
Hmm, c#1 doesn't work well since EWInstance is stopped from the renderer side when the script is identical.
We may need to think a bit more how ownerships should be.

Sign in to add a comment