Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 52f9bcc211e160f6e3a8fb43a8af941be1892af8
      
https://github.com/WebKit/WebKit/commit/52f9bcc211e160f6e3a8fb43a8af941be1892af8
  Author: Youenn Fablet <[email protected]>
  Date:   2024-11-06 (Wed, 06 Nov 2024)

  Changed paths:
    M Source/WebCore/workers/service/server/SWServer.h
    M Source/WebCore/workers/service/server/SWServerWorker.cpp
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
    M 
Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp
    M Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
    M Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
    M Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm

  Log Message:
  -----------
  NetworkProcessProxy should handle the case of busy looping service workers in 
a process containing web pages
rdar://138626537
https://bugs.webkit.org/show_bug.cgi?id=282091

Reviewed by Ben Nham.

Add some logging for when a service worker becomes unresponsive.
Update the method names and IPC message to make it clearer that this is a 
service worker that is unresponsive, not the process itself.
Instead of requesting termination directly, we simply disable remote workers.
If disabling remote workers fails, the process will exit by itself.
If the process is hanging, a follow-up patch might make sure that the process 
gets killed as part of https://bugs.webkit.org/show_bug.cgi?id=282319.

When sending the notification that the service worker process is unresponsive 
to UIProcess, we make sure to close the SWContext connection.
This in turns stop all service workers running in that process.

* Source/WebCore/workers/service/server/SWServer.h:
(WebCore::SWServer::isProcessTerminationDelayEnabled const):
* Source/WebCore/workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::startTermination):
(WebCore::SWServerWorker::callTerminationCallbacks):
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::terminateDueToUnresponsiveness):
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::processHasUnresponseServiceWorker):
(WebKit::NetworkProcessProxy::terminateUnresponsiveServiceWorkerProcesses): 
Deleted.
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.h:
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didExceedCPULimit):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
((ServiceWorkers, SuspendAndTerminateWorker)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to