-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 3c2c899. rdar://126479653
WebKit process termination with xpc_connection_kill does not always work https://bugs.webkit.org/show_bug.cgi?id=272669 rdar://126479653 Reviewed by Chris Dumez. WebKit process termination with xpc_connection_kill does not always work. We are currently seeing flaky termination behavior on macOS, where the child processes are not always terminated successfully. Additionally, on iOS, the XPC connection has become anonymous due to migration to extensions for WebKit processes, and xpc_connection_kill does not support anonymous connections. This patch addresses this issue by creating and sending a XPC message to the child process to request termination. This has a high chance of success, since we know that the XPC connection termination watchdog is holding a background assertion on the process, so it is not suspended. Additionally, the XPC message is being handled on the XPC event handler thread, which is handling very few messages, so it is very unlikely that it is blocked and cannot handle the message. This gives the process a chance to exit cleanly and send a reply back. If the UI process does not receive the expected reply, it will try calling xpc_connection_kill. * Source/WebKit/Platform/cocoa/XPCUtilities.h: * Source/WebKit/Platform/cocoa/XPCUtilities.mm: (WebKit::terminateWithReason): (WebKit::handleXPCExitMessage): * Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: (WebKit::AuthenticationManager::initializeConnection): * Source/WebKit/Shared/Cocoa/XPCEndpoint.mm: (WebKit::XPCEndpoint::XPCEndpoint): * Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceEventHandler): Canonical link: https://commits.webkit.org/277509@main
- Loading branch information
Showing
5 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters