0
Files
src/remoting
Yuwei Huang a74f860f84 [crd host] Handle unexpected agent process broker disconnection
The host isn't aware that the agent process broker process could exit
unexpectedly (e.g. crash), and it treats all mojo remote disconnections
as the broker requesting termination of the process and reports
kTerminatedByAgentProcessBroker, which is problematic since it's
considered a "permanent" exit code and the host service will not bother
to restart the host process.

This CL fixes this by making the broker disconnect with a specific error
reason when it actually requests termination of the process. When the
broker exits unexpectedly, the receiver will disconnect without a
reason, and the client will use this information to determine which
error code to report. In case of unexpected disconnection, a new
non-permanent error code kAgentProcessBrokerDisconnected is introduced,
which allows the host service to restart the host process, which will
cause launchd to attempt to relaunch the agent process broker when the
mojo IPC is made.

Bug: 406127470
Change-Id: Ic7f99623f4975b2cef81f7172965da5e7f9deac3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6394304
Auto-Submit: Yuwei Huang <yuweih@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1438361}
2025-03-26 13:26:02 -07:00
..
2025-02-02 23:30:48 -08:00
2025-02-02 23:30:48 -08:00