Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWServerJobQueue::scriptContextStarted might have a null registration
https://bugs.webkit.org/show_bug.cgi?id=259591 rdar://112997411 Reviewed by Alex Christensen. From logs, it appears SWServerJobQueue::scriptContextStarted might have a nullptr registration. One possibility is the following: - A main thread service worker page is created. - The service worker is being installed (in main thread) and succeeds. This triggers a callOnMainThread to execute the callback that will notify network process to continue its processing - Before the callback is executed, the service worker page is closed and the network process is notified about this. - The network process removes the registration from its map in SWServer::unregisterServiceWorkerClient. - The network process processes the message to continue installing the service worker and continue with the current job. To prevent this, we are now making sure to cancel the job of a preinstalling service worker whose registration is removed in SWServer::unregisterServiceWorkerClient. Since this is a speculative fix, we transform the ASSERT(registration) in an if+ASSERT. We add logging to make sure to keep track of this, in case this might trigger job queue hangs. * Source/WebCore/workers/service/server/SWServer.cpp: (WebCore::SWServer::unregisterServiceWorkerClient): * Source/WebCore/workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptContextFailedToStart): (WebCore::SWServerJobQueue::scriptContextStarted): Canonical link: https://commits.webkit.org/266419@main
- Loading branch information