Current tab process is not correctly prioritized
Categories
(GeckoView Graveyard :: Sandboxing, enhancement, P1)
Tracking
(firefox98 wontfix, firefox99 wontfix, firefox100 fixed)
People
(Reporter: agi, Assigned: calu, Mentored)
References
(Blocks 1 open bug)
Details
(Whiteboard: [geckoview:m99][geckoview:m100][fission:android:m3] [geckoview:m101])
Attachments
(2 files)
During our investigation for Bug 1752632, we noticed that Fenix does not prioritize the current tab appropriately when the screen is off or the browser is in the background.
In our testing, when in foreground, both the main process and the current tab process receive an oom_adj
of 0
, which is correct.
When the app is in the background, however, the main process receives an oom_adj
score of 11
, while the main tab has a score of 16
. Worse yet, when the screen is off the main process has a score of 0
but the tab process has a score of 16
.
We should prioritize the current tab process at the same level as the main process. From our investigation, this is due to the fact that when we lose the surface associate to the current tab, we don't know what the current tab is anymore, so we can't prioritize it accordingly.
We could use the extension's activeTab as a hint that the tab is still the current one and prioritize the process accordingly.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Agi says this process priority work is needed for Android Fission.
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Prior behavior for active tabs in an inactive app would have the process priority oom score of 15. Now it's set to a higher priority oom score of 11. This will increase priority for recently used tabs on apps and prevent Android from unloading them.
Depends on D141531
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Backed out for causing linting failures on browser_ProcessPriorityManager.js.
[task 2022-04-01T16:16:34.860Z] /builds/worker/checkouts/gecko/testing
[task 2022-04-01T16:16:34.871Z] 16:16:34.871 eslint (109) | Command: /usr/local/bin/node /builds/worker/checkouts/gecko/node_modules/eslint/bin/eslint.js --ext [js,jsm,jsx,xul,html,xhtml,sjs] --format json --no-error-on-unmatched-pattern --ignore-pattern testing/web-platform/tests/tools/third_party --ignore-pattern testing/talos/talos/tests/dromaeo --ignore-pattern gfx/vr/service/openvr --ignore-pattern editor/libeditor/tests/browserscope/lib --ignore-pattern dom/media/webspeech/recognition/energy_endpointer_params.cc --ignore-pattern testing/xpcshell/node-http2 --ignore-pattern testing/mochitest/tests/MochiKit-1.4.2 --ignore-pattern dom/webauthn/tests/pkijs --ignore-pattern testing/modules/sinon-7.2.7.js --ignore-pattern gfx/skia --ignore-pattern dom/media/platforms/ffmpeg/ffmpeg58 --ignore-pattern dom/tests/mochitest/ajax --ignore-pattern dom/canvas/test/webgl-conf/checkout --ignore-pattern dom/media/platforms/ffmpeg/libav53 --ignore-pattern dom/media/webspeech/recognition/endpointer.cc --ignore-pattern dom/media/webspeech/recognition/energy_endpointer.cc --ignore-pattern dom/media/gmp/widevine-adapter/content_decryption_module_ext.h --ignore-pattern dom/media/webvtt/vtt.jsm --ignore-pattern testing/web-platform/tests/resources/webidl2 --ignore-pattern dom/media/webspeech/recognition/energy_endpointer_params.h --ignore-pattern dom/media/gmp/widevine-adapter/content_decryption_module.h --ignore-pattern testing/mozbase/mozproxy/mozproxy/backends/mitm/scripts/catapult --ignore-pattern gfx/angle/checkout --ignore-pattern dom/tests/mochitest/dom-level1-core --ignore-pattern gfx/wr --ignore-pattern testing/xpcshell/dns-packet --ignore-pattern gfx/harfbuzz --ignore-pattern dom/webauthn/cbor-cpp --ignore-pattern gfx/ycbcr --ignore-pattern testing/talos/talos/tests/kraken --ignore-pattern dom/media/gmp/widevine-adapter/content_decryption_module_proxy.h --ignore-pattern dom/media/webaudio/test/blink --ignore-pattern dom/media/gmp/rlz --ignore-pattern gfx/qcms --ignore-pattern gfx/ots --ignore-pattern testing/mochitest/pywebsocket3 --ignore-pattern testing/mochitest/MochiKit --ignore-pattern dom/media/platforms/ffmpeg/ffmpeg59 --ignore-pattern intl/unicharutil/util/nsSpecialCasingData.cpp --ignore-pattern gfx/graphite2 --ignore-pattern testing/gtest/gtest --ignore-pattern intl/unicharutil/util/nsUnicodePropertyData.cpp --ignore-pattern testing/modules/ajv-6.12.6.js --ignore-pattern dom/media/gmp/widevine-adapter/content_decryption_module_export.h --ignore-pattern dom/u2f/tests/pkijs --ignore-pattern layout/docs/css-gap-decorations --ignore-pattern intl/icu --ignore-pattern testing/talos/talos/tests/v8_7 --ignore-pattern dom/media/platforms/ffmpeg/ffmpeg57 --ignore-pattern gfx/cairo --ignore-pattern dom/tests/mochitest/dom-level2-html --ignore-pattern dom/media/webspeech/recognition/energy_endpointer.h --ignore-pattern dom/media/webrtc/transport/third_party --ignore-pattern dom/tests/mochitest/dom-level2-core --ignore-pattern testing/gtest/gmock --ignore-pattern dom/media/webspeech/recognition/endpointer.h --ignore-pattern dom/imptests --ignore-pattern dom/media/platforms/ffmpeg/libav55 --ignore-pattern intl/components/src/UnicodeScriptCodes.h --ignore-pattern testing/xpcshell/odoh-wasm --ignore-pattern testing/xpcshell/node-ip --ignore-pattern dom/media/platforms/ffmpeg/libav54 /builds/worker/checkouts/gecko/editor /builds/worker/checkouts/gecko/layout /builds/worker/checkouts/gecko/gfx /builds/worker/checkouts/gecko/uriloader /builds/worker/checkouts/gecko/widget /builds/worker/checkouts/gecko/gradle /builds/worker/checkouts/gecko/intl /builds/worker/checkouts/gecko/accessible /builds/worker/checkouts/gecko/docshell /builds/worker/checkouts/gecko/dom /builds/worker/checkouts/gecko/testing
[task 2022-04-01T16:17:03.921Z] 16:17:03.921 eslint (107) | Finished in 29.27 seconds
[task 2022-04-01T16:17:31.580Z] 16:17:31.580 eslint (106) | Finished in 56.93 seconds
[task 2022-04-01T16:21:18.521Z] 16:21:18.521 eslint (109) | Finished in 283.87 seconds
[task 2022-04-01T16:25:18.878Z] 16:25:18.878 eslint (108) | Finished in 524.23 seconds
[task 2022-04-01T16:25:18.888Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/dom/ipc/tests/browser_ProcessPriorityManager.js:334:9 | listen for events instead of setTimeout() with arbitrary delay (mozilla/no-arbitrary-setTimeout)
[taskcluster 2022-04-01 16:25:19.225Z] === Task Finished ===
[taskcluster 2022-04-01 16:25:19.806Z] Unsuccessful task run with exit code: 1 completed in 548.493 seconds
Updated•3 years ago
|
Updated•3 years ago
|
Comment 8•3 years ago
|
||
Backed out for causing android mochitest failures on test_ext_tabs_getCurrent.html.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=373147197&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/660bc4607826fa9c262c73b424eeb6f9361ba2d5
[task 2022-04-01T22:10:44.146Z] 22:10:44 INFO - TEST-PASS | mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html | getCurrent in non-active background tab - Expected: moz-extension://1c050fcb-e036-4d30-86a4-06562a05a378/tab.html, Actual: moz-extension://1c050fcb-e036-4d30-86a4-06562a05a378/tab.html
[task 2022-04-01T22:10:44.146Z] 22:10:44 INFO - Buffered messages finished
[task 2022-04-01T22:10:44.146Z] 22:10:44 WARNING - TEST-UNEXPECTED-FAIL | mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html | Test timed out. -
[task 2022-04-01T22:10:44.147Z] 22:10:44 WARNING - TEST-UNEXPECTED-FAIL | mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html | Extension left running at test shutdown
[task 2022-04-01T22:10:44.147Z] 22:10:44 INFO - SimpleTest.ok@SimpleTest/SimpleTest.js:417:16
[task 2022-04-01T22:10:44.147Z] 22:10:44 INFO - ExtensionTestUtils.loadExtension/<@SimpleTest/ExtensionTestUtils.js:133:18
[task 2022-04-01T22:10:44.147Z] 22:10:44 INFO - executeCleanupFunction@SimpleTest/SimpleTest.js:1487:13
[task 2022-04-01T22:10:44.147Z] 22:10:44 INFO - SimpleTest.finish@SimpleTest/SimpleTest.js:1501:3
[task 2022-04-01T22:10:44.148Z] 22:10:44 INFO - killTest@SimpleTest/TestRunner.js:194:22
[task 2022-04-01T22:10:44.148Z] 22:10:44 INFO - async*delayedKillTest@SimpleTest/TestRunner.js:231:17
[task 2022-04-01T22:10:44.148Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:229:17
[task 2022-04-01T22:10:44.148Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.148Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.148Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.149Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.149Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.149Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.149Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.149Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.150Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.150Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.150Z] 22:10:44 INFO - setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:242:15
[task 2022-04-01T22:10:44.150Z] 22:10:44 INFO - TestRunner.runTests/<@SimpleTest/TestRunner.js:521:16
[task 2022-04-01T22:10:44.150Z] 22:10:44 INFO - Async*TestRunner.runTests@SimpleTest/TestRunner.js:508:48
[task 2022-04-01T22:10:44.151Z] 22:10:44 INFO - RunSet.runtests@SimpleTest/setup.js:232:14
[task 2022-04-01T22:10:44.151Z] 22:10:44 INFO - RunSet.runall@SimpleTest/setup.js:211:12
[task 2022-04-01T22:10:44.151Z] 22:10:44 INFO - hookupTests@SimpleTest/setup.js:308:12
[task 2022-04-01T22:10:44.151Z] 22:10:44 INFO - parseTestManifest@http://mochi.test:8888/manifestLibrary.js:51:13
[task 2022-04-01T22:10:44.152Z] 22:10:44 INFO - getTestManifest/req.onload@http://mochi.test:8888/manifestLibrary.js:64:28
[task 2022-04-01T22:10:44.152Z] 22:10:44 INFO - EventHandlerNonNull*getTestManifest@http://mochi.test:8888/manifestLibrary.js:60:3
[task 2022-04-01T22:10:44.152Z] 22:10:44 INFO - hookup@SimpleTest/setup.js:284:20
[task 2022-04-01T22:10:44.152Z] 22:10:44 INFO - EventHandlerNonNull*@http://mochi.test:8888/tests?autorun=1&closeWhenDone=1&logFile=%2Fdata%2Flocal%2Ftmp%2Ftest_root%2Flogs%2Fmochitest.log&fileLevel=INFO&consoleLevel=INFO&hideResultsTable=1&manifestFile=tests.json&dumpOutputDirectory=%2Fdata%2Flocal%2Ftmp%2Ftest_root:11:1
[task 2022-04-01T22:10:44.153Z] 22:10:44 WARNING - TEST-UNEXPECTED-FAIL | mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html | no tasks awaiting on messages - got "[\"tab-finished\"]", expected "[]"
[task 2022-04-01T22:10:44.153Z] 22:10:44 INFO - SimpleTest.is@SimpleTest/SimpleTest.js:500:14
[task 2022-04-01T22:10:44.154Z] 22:10:44 INFO - ExtensionTestUtils.loadExtension/<@SimpleTest/ExtensionTestUtils.js:52:18
[task 2022-04-01T22:10:44.155Z] 22:10:44 INFO - executeCleanupFunction@SimpleTest/SimpleTest.js:1487:13
[task 2022-04-01T22:10:44.155Z] 22:10:44 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html | took 319935ms
[task 2022-04-01T22:10:44.155Z] 22:10:44 WARNING - TEST-UNEXPECTED-FAIL | /tests/mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html logged result after SimpleTest.finish(): Extension left running at test shutdown
[task 2022-04-01T22:10:44.155Z] 22:10:44 WARNING - TEST-UNEXPECTED-FAIL | /tests/mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html logged result after SimpleTest.finish(): no tasks awaiting on messages
[task 2022-04-01T22:10:44.155Z] 22:10:44 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_goBack_goForward.html
[task 2022-04-01T22:10:44.155Z] 22:10:44 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_goBack_goForward.html | took 584ms
[task 2022-04-01T22:10:44.156Z] 22:10:44 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_insertCSS.html
[task 2022-04-01T22:10:44.156Z] 22:10:44 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_insertCSS.html | took 394ms
[task 2022-04-01T22:10:44.157Z] 22:10:44 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_onUpdated.html
[task 2022-04-01T22:10:44.157Z] 22:10:44 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_onUpdated.html | took 1226ms
[task 2022-04-01T22:10:44.157Z] 22:10:44 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_query.html
[task 2022-04-01T22:10:44.157Z] 22:10:44 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_query.html | took 296ms
[task 2022-04-01T22:10:44.157Z] 22:10:44 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload.html
[task 2022-04-01T22:10:54.248Z] 22:10:54 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload.html | took 430ms
[task 2022-04-01T22:10:54.249Z] 22:10:54 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload_bypass_cache.html
[task 2022-04-01T22:10:54.249Z] 22:10:54 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload_bypass_cache.html | took 517ms
[task 2022-04-01T22:10:54.249Z] 22:10:54 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_sendMessage.html
[task 2022-04-01T22:10:54.251Z] 22:10:54 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_sendMessage.html | took 1025ms
[task 2022-04-01T22:10:54.251Z] 22:10:54 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_tabs_update_url.html
[task 2022-04-01T22:10:54.253Z] 22:10:54 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_tabs_update_url.html | took 942ms
[task 2022-04-01T22:10:54.253Z] 22:10:54 INFO - TEST-START | mobile/android/components/extensions/test/mochitest/test_ext_webNavigation_onCommitted.html
[task 2022-04-01T22:10:54.253Z] 22:10:54 INFO - TEST-OK | mobile/android/components/extensions/test/mochitest/test_ext_webNavigation_onCommitted.html | took 318ms
[task 2022-04-01T22:10:54.253Z] 22:10:54 INFO - TEST-START | Shutdown
Reporter | ||
Comment 9•3 years ago
|
||
From the logs:
04-01 22:05:20.814 18541 18556 I GeckoDump: Console message: [JavaScript Error: "can't access property "priorityHint", browser.frameLoader.remoteTab is null" {file: "resource://gre/modules/GeckoViewWebExtension.jsm" line: 547}]
04-01 22:05:20.814 18541 18556 I GeckoDump: setTabActive@resource://gre/modules/GeckoViewWebExtension.jsm:547:5
04-01 22:05:20.814 18541 18556 I GeckoDump: update@chrome://geckoview/content/ext-tabs.js:449:33
04-01 22:05:20.814 18541 18556 I GeckoDump: Async*recvAPICall/result</<@resource://gre/modules/ExtensionParent.jsm:991:68
04-01 22:05:20.814 18541 18556 I GeckoDump: withPendingBrowser@resource://gre/modules/ExtensionParent.jsm:497:26
04-01 22:05:20.814 18541 18556 I GeckoDump: recvAPICall/result<@resource://gre/modules/ExtensionParent.jsm:991:24
04-01 22:05:20.814 18541 18556 I GeckoDump: callAndLog@resource://gre/modules/ExtensionParent.jsm:945:14
04-01 22:05:20.814 18541 18556 I GeckoDump: recvAPICall@resource://gre/modules/ExtensionParent.jsm:990:25
04-01 22:05:20.814 18541 18556 I GeckoDump: Async*_recv@resource://gre/modules/ConduitsChild.jsm:82:20
04-01 22:05:20.814 18541 18556 I GeckoDump: receiveMessage@resource://gre/modules/ConduitsParent.jsm:450:20
04-01 22:05:20.814 18541 18556 I GeckoDump: JSActor query*_send@resource://gre/modules/ConduitsChild.jsm:67:11
04-01 22:05:20.814 18541 18556 I GeckoDump: _send@resource://gre/modules/ConduitsChild.jsm:115:18
04-01 22:05:20.814 18541 18556 I GeckoDump: callParentAsyncFunction@resource://gre/modules/ExtensionChild.jsm:877:18
04-01 22:05:20.814 18541 18556 I GeckoDump: callAsyncFunction@resource://gre/modules/ExtensionChild.jsm:629:33
04-01 22:05:20.814 18541 18556 I GeckoDump: stub@resource://gre/modules/Schemas.jsm:2838:30
04-01 22:05:20.814 18541 18556 I GeckoDump: @moz-extension://1c050fcb-e036-4d30-86a4-06562a05a378/tab.js:20:24
04-01 22:05:20.814 18541 18556 I GeckoDump: JSActor query*_send@resource://gre/modules/ConduitsChild.jsm:67:11
04-01 22:05:20.814 18541 18556 I GeckoDump: _send@resource://gre/modules/ConduitsParent.jsm:290:18
04-01 22:05:20.814 18541 18556 I GeckoDump: reply@resource://gre/modules/ExtensionParent.jsm:978:20
04-01 22:05:20.814 18541 18556 I GeckoDump: recvAPICall/<@resource://gre/modules/ExtensionParent.jsm:1003:18
04-01 22:05:20.814 18541 18556 I GeckoDump: JSActor query*_send@resource://gre/modules/ConduitsChild.jsm:67:11
04-01 22:05:20.814 18541 18556 I GeckoDump: _send@resource://gre/modules/ConduitsChild.jsm:115:18
04-01 22:05:20.814 18541 18556 I GeckoDump: callParentAsyncFunction@resource://gre/modules/ExtensionChild.jsm:877:18
04-01 22:05:20.814 18541 18556 I GeckoDump: callAsyncFunction@resource://gre/modules/ExtensionChild.jsm:629:33
04-01 22:05:20.814 18541 18556 I GeckoDump: stub@resource://gre/modules/Schemas.jsm:2838:30
04-01 22:05:20.814 18541 18556 I GeckoDump: @moz-extension://1c050fcb-e036-4d30-86a4-06562a05a378/tab.js:4:22
04-01 22:05:20.814 18541 18556 I GeckoDump: @moz-extension://1c050fcb-e036-4d30-86a4-06562a05a378/tab.js:22:9
I think the problem is that the tab in the test is not a remote tab (i.e. it loads on the parent process) because it's an extension page.
Reporter | ||
Comment 10•3 years ago
|
||
... but it doesn't matter! as Android apps cannot prioritize the main process anyway, so we can just ignore this when remoteTab
is null:
browser.frameLoader.remoteTab?.priorityHint = aActive;
Comment 11•3 years ago
|
||
bugherder |
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Reporter | ||
Updated•3 years ago
|
Comment 15•2 years ago
|
||
Moving Android Fission bugs to the new GeckoView::Sandboxing component.
Updated•6 months ago
|
Description
•