[Experiment] [process-count-4] Same domain tabs are loaded in the same process when reloaded in bulk
Categories
(Core :: DOM: Content Processes, defect, P3)
Tracking
()
Fission Milestone | Future |
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | disabled |
firefox-esr91 | --- | disabled |
firefox91 | --- | disabled |
firefox92 | --- | wontfix |
firefox93 | --- | fix-optional |
firefox94 | --- | fix-optional |
People
(Reporter: cmuresan, Assigned: nika)
References
Details
Attachments
(2 files)
[Affected versions]:
- Firefox Nightly 93.0a1 - Build ID: 20210830162701
[Affected Platforms]:
- Windows 10
- macOS 10.15.7
- Linux MX 4.19
[Prerequisites]:
- Have the following prefs set on a new profile:
dom.ipc.processCount.webIsolated
set to4
.fission.autostart
set totrue
.
[Steps to reproduce]:
- Open 10 webpages from the same domain (eg. facebook, google, wikipedia) each in a new tab.
- Open the about:processes page in a new tab.
- Restart the browser using the Multiprocess Browser Console (
ctrl/cmd+shift+j
followed byctrl/cmd+alt/option+r
). - Right click the about:processes tab and choose the "Select all Tabs" option.
- Right click the same tab and select the "Reload Tabs" option.
- Wait for all tabs to load and observe the process list.
[Expected result]:
- The tabs with the same domain are split into 4 processes.
[Actual result]:
- The tabs with the same domain are all in the same process.
[Notes]:
- The issue is also reproducible when selecting multiple tabs and reloading them simultaneously, but in this case they can end up in two processes.
- The issue is also reproducible if the tabs are unloaded via Session Restore.
- The issue is NOT reproducible if the tabs are loaded one at a time.
- The issue is NOT reproducible if the tabs are opened at the same time from a Bookmark folder or from the Synced Tabs sidebar.
- Attached a screen recording of the issue: link.
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Took a second to look into this. I believe this is caused because we always choose not to create a new process for a remote type if an existing process doesn't have any tabs loaded in it. This is done here: https://searchfox.org/mozilla-central/rev/ad2ffab089e4e0c0fe99a1a046ab2b1c45546bdb/dom/base/ProcessSelector.jsm#49-53. With normal tab opening we would create the browser in each new process synchronously, due to the blocking process launch, but for navigation process switches with Fission, we create it async, and there's a short time period during the process switch where we have the new process launched, but it doesn't have any tabs technically loaded in it yet. During this time if we do another process switching navigation, we'll end up re-using the same process, as we don't see the process as having any tabs loaded in it.
If we want to avoid this behaviour, we'll need to track pending navigations into a content process in addition to existing tabs, and handle them here.
Updated•2 years ago
|
Comment 2•2 years ago
|
||
This bug will only affect users if we decide to increase the process count to greater than 1 process (bug 1727158), depending on the results of this experiment.
Comment 3•2 years ago
|
||
Tracking for Fission MVP.
Tentatively assigning to Nika because she knows the details of this bug.
Comment 4•2 years ago
|
||
We'd like to fix this bug, but it doesn't need to block Fission MVP.
Assignee | ||
Comment 5•2 years ago
|
||
The changes I currently have posted in bug 1731792 should also fix this issue.
Comment 6•1 year ago
|
||
(In reply to Nika Layzell [:nika] (ni? for response) from comment #5)
The changes I currently have posted in bug 1731792 should also fix this issue.
Hi Nika, in bug 1731792 there are still two patches ready to land, do we know if this bug here is already fixed?
In case this bug is still valid instead, were you still planning to look into this?
Assignee | ||
Comment 7•1 year ago
|
||
This patch replaces the previous process selection infrastructure with a
new setup implemented entirely in C++, which should more accurately
track the set of processes in use, and should encourage re-use of the
existing content process when navigating by not counting the current
tab.
This approach intentionally allows for process switching to another
process during navigation if there is uneven load between processes to
encourage balanced process use.
I think this may also fix some of the session restore issues with many
tabs using the same process, rather than being spread over 4, as we now
track a tab earlier in its lifecycle before the BrowserParent instance
is created.
Assignee | ||
Comment 8•1 year ago
|
||
This attribute is not used in Gecko, but exists for use by other
applications. Specifically, the APP_TYPE_EDITOR type is given permission
to load privileged images as tested by browser_docshell_type_editor.js.
Before these changes, that test passed because the docshell was loaded
in a different process, so the cache was empty when each load occurred,
but after my changes the process ends up being re-used, so the image
cache bypasses this check.
This changes the image cache key to also include the app type
information so that it will be compared before re-using the entry.
Assignee | ||
Comment 9•1 year ago
|
||
The patch in that bug which landed didn't fix this issue, only the other 2 patches which bounced due to a devtools failure actually fixed this bug.
It appears that the devtools team did some work fixing an intermittent issue around this in bug 1733272, so it may be worth rebasing those patches and seeing if they're landable now.
Assignee | ||
Comment 10•1 year ago
|
||
I've moved the patches over to this bug, so that they're not on a closed bug anymore.
Comment 11•1 year ago
|
||
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e9242af1224d Part 1: Avoid cycling between processes when navigating within a tab, r=smaug https://hg.mozilla.org/integration/autoland/rev/b6649f0253c5 Part 2: Respect AppType in ImageCacheKey, r=emilio
Comment 12•1 year ago
|
||
Backed out for causing failures at RTCPeerConnection-videoDetectorTest.html.
Backout link: https://hg.mozilla.org/integration/autoland/rev/a38cd8866cf1aa4de586e9a91994e1b1054163bd
Failure log: https://treeherder.mozilla.org/logviewer?job_id=372604585&repo=autoland&lineNumber=84711
Comment 13•1 year ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:nika, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.
Updated•1 year ago
|
Assignee | ||
Comment 14•1 year ago
|
||
These are fairly low-importance patches with confusing test failures which I haven't had the time to investigate yet.
Description
•