Open Bug 2001484 Opened 14 days ago Updated 3 days ago

Consider batching MessageChannel error notifications during DropPeer

Categories

(Core :: IPC, enhancement)

enhancement

Tracking

()

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(1 file)

In bug 1981051, we encountered issues where we would end up creating a large number of actors between a single content process and the parent process, leading to the parent process IO thread hanging dispatching hundreds of thousands of MessageChannel error notifications to the actor's background task queue.

This bug is to track a potential solution to this problem, which is to explicitly batch together multiple MessageChannel error notifications destined for a single event target if they are triggered by peer loss in this way.

This would be done explicitly using a RAII object and thread local in NodeController, and shouldn't impact the behaviour or timing of other MessageChannel error notifications.

The goal of this change is to avoid potential pitfalls which could come about
when creating a very large number of toplevel IPC actors between a child
process and the parent process.

In bug 1981051, we encountered issues where we would end up creating a large
number of PRemoteLazyInputStream actors between the parent process and a
content process, which led to hangs on the IO thread when the process exited.

With this change, the error notify code will check for the opportunity to batch
dispatches when on the IPC I/O thread. In cases like the one in bug 1981051,
this should dramatically reduce the amount of lock contention we encounter when
losing communication with a process.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: