Bug 1907454 - [1/1] Send `ActorDestroyReason` up into telemetry r=ipc-reviewers,nika

File-picker telemetry shows that most failures to open the file dialog
remotely arise in `UtilityProcessHost::OnChannelClosed`. This ultimately
derives from `IProtocol::ActorDisconnected()`, which is called from many
points, mostly generated code.

Rather than jumping in and writing error-propagation code all the way
back up the stack, send what little information we can easily access up
to the file-picker failure telemetry; this should narrow down what
portion of the code we need to look at to determine the root cause of
these failures.

Differential Revision: https://phabricator.services.mozilla.com/D216350
This commit is contained in:
Ray Kraesig 2024-07-15 18:43:14 +00:00
Родитель c1f13f1338
Коммит 5f27dd7061
3 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -277,11 +277,15 @@ void UtilityProcessHost::Shutdown() {
DestroyProcess();
}
void UtilityProcessHost::OnChannelClosed() {
void UtilityProcessHost::OnChannelClosed(
IProtocol::ActorDestroyReason aReason) {
MOZ_ASSERT(NS_IsMainThread());
LOGD("[%p] UtilityProcessHost::OnChannelClosed", this);
RejectPromise(LaunchError("UtilityProcessHost::OnChannelClosed"));
// `aReason` was not originally passed into this function; a value of 0 for
// the `why` in telemetry means it's from an older build with no info
RejectPromise(
LaunchError("UtilityProcessHost::OnChannelClosed", 1 + (long)aReason));
if (!mShutdownRequested && mListener) {
// This is an unclean shutdown. Notify our listener that we're going away.

Просмотреть файл

@ -100,7 +100,7 @@ class UtilityProcessHost final : public mozilla::ipc::GeckoChildProcessHost {
// Called on the main thread when the mUtilityProcessParent actor is shutting
// down.
void OnChannelClosed();
void OnChannelClosed(IProtocol::ActorDestroyReason aReason);
// Kill the remote process, triggering IPC shutdown.
void KillHard(const char* aReason);

Просмотреть файл

@ -177,7 +177,7 @@ void UtilityProcessParent::ActorDestroy(ActorDestroyReason aWhy) {
NS_WARNING("Could not get a nsIObserverService, ipc:utility-shutdown skip");
}
mHost->OnChannelClosed();
mHost->OnChannelClosed(aWhy);
}
// To ensure that IPDL is finished before UtilityParent gets deleted.