[webkit-changes] [WebKit/WebKit] f6a1bd: http/tests/workers/service/self_registration.html ...

youennf noreply at github.com
Wed Oct 11 00:15:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f6a1bd73126d7dc9960768e273f2848fcee76d83
      https://github.com/WebKit/WebKit/commit/f6a1bd73126d7dc9960768e273f2848fcee76d83
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-10-11 (Wed, 11 Oct 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/workers/service/SWClientConnection.cpp
    M Source/WebCore/workers/service/context/SWContextManager.cpp
    M Source/WebCore/workers/service/context/SWContextManager.h
    M Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
    M Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
    M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp
    M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h
    M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp
    M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h
    M Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in
    M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
    M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h
    M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in

  Log Message:
  -----------
  http/tests/workers/service/self_registration.html is a flaky text failure.
https://bugs.webkit.org/show_bug.cgi?id=260823
rdar://114590106

Reviewed by Chris Dumez.

Worker state updates (and events) and Message events are queued on the same DOM manipulation task source.
We moved message events handling to: IPC thread -> context manager work queue -> service worker thread.
But some events are using the past code path: IPC thread -> main thread -> service worker thread.
This is triggering message events to fire faster than the other events/state updaters.

We are now moving all DOM manipulation task source events fired on the service worker to the same code path
(IPC thread -> context manager work queue -> service worker thread).
This includes install, activate, updatefound, statechange, message events.

I was not able to reproduce the http/tests/workers/service/self_registration.html flakiness locally
but this patch should fix this race and should be covered by this test.

* LayoutTests/TestExpectations:
* Source/WebCore/workers/service/SWClientConnection.cpp:
(WebCore::forDedicatedAndSharedWorkers):
(WebCore::forAllWorkers):
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::updateWorkerState):
(WebCore::SWClientConnection::fireUpdateFoundEvent):
* Source/WebCore/workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::updateRegistrationState):
(WebCore::SWContextManager::updateWorkerState):
(WebCore::SWContextManager::fireUpdateFoundEvent):
* Source/WebCore/workers/service/context/SWContextManager.h:
* Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::fireActivateEvent):
* Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h:
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::swContextConnection):
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::networkProcess):
(WebKit::WebSWServerConnection::updateRegistrationStateInClient):
(WebKit::WebSWServerConnection::fireUpdateFoundEvent):
(WebKit::WebSWServerConnection::updateWorkerStateInClient):
(WebKit::WebSWServerConnection::scheduleJobInServer):
(WebKit::WebSWServerConnection::registerServiceWorkerClientInternal):
(WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
(WebKit::WebSWServerConnection::contextConnectionCreated):
(WebKit::WebSWServerConnection::session):
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::networkProcess):
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::fireActivateEvent):
(WebKit::WebSWContextManagerConnection::updateRegistrationState):
(WebKit::WebSWContextManagerConnection::updateWorkerState):
(WebKit::WebSWContextManagerConnection::fireUpdateFoundEvent):
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h:
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in:

Canonical link: https://commits.webkit.org/269191@main




More information about the webkit-changes mailing list