Open Bug 1845785 Opened 1 year ago Updated 1 year ago

ProcessSelector.sys.mjs's provideProcess method should ignore processes that are shutting down

Categories

(Core :: DOM: Content Processes, task)

task

Tracking

()

People

(Reporter: robwu, Unassigned)

References

Details

The result of a call to provideProcess in ProcessSelector.sys.mjs can still be ignored by ContentParent::GetUsedBrowserProcess when the chosen ContentParent is shutting down. Because of this, it is possible for a new content process to be spawned when there are perfectly available content processes otherwise. (see below for caveat)
ProcessSelector.sys.mjs could be updated to only select among eligible processes to minimize the likelihood of this issue occurring. A similar issue may be described by bug 1596254, but in the other case it's about nulls, whereas this bug is about ContentProcess instances that are being shut down.

Caveat: As of writing, the mIsSignaledImpendingShutdown flag backing isShuttingDown (source) is almost always set together with a call to MarkAsDead. As part of MarkAsDead, the ContentParent is removed from the global list of eligible ContentParents (source). So this is only an issue when MarkAsDead is not called, and as of writing there are two cases, which only happen at browser shutdown:

Because of the above observations, an alternative to fixing this is to exit earlier to not even reach the process selection logic, e.g. as part of bug 1845778.

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