Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very slow start up with pinned tabs #532

Closed
MoscaDotTo opened this issue Sep 9, 2021 · 8 comments
Closed

Very slow start up with pinned tabs #532

MoscaDotTo opened this issue Sep 9, 2021 · 8 comments

Comments

@MoscaDotTo
Copy link

  • Temporary Containers Version: 1.9.2
  • Firefox Version: 94.0a1

Actual behavior

When Temporary Containers are enabled and Firefox is configured to have pinned tabs, the browser initialization is delayed for quite a while

Expected behavior

The browser should not hang while trying to reload open tabs

Steps to reproduce

Create a new profile
Pin 1 or more tabs
Restart firefox
There is a delay before old tab content is loaded and which prevents new tab content from being loaded. You can see this in the loading animation on each tab as well. On my active use profile, it persists for 15-30 seconds before loading anything, even built in pages like about:addons. Disabling temporary containers solves the issue entirely.

Notes

target.join is not a function (4) background.js:578
target.join is not a function (6) background.js:578
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
Uncaught (in promise) Timed out while waiting for Add-on to initialize background.js:595:23
target.join is not a function (33) background.js:578
Unchecked lastError value: Error: ID already exists: remove-open-in-this-container assignManager.js:643
Unchecked lastError value: Error: ID already exists: separator assignManager.js:651
Unchecked lastError value: Error: ID already exists: hide-container assignManager.js:657
Unchecked lastError value: Error: ID already exists: move-to-new-window-container assignManager.js:663
target.join is not a function (114) background.js:578

@stoically
Copy link
Owner

Tried to reproduce with the given steps,

  • Create a new profile
  • Install TC
  • Pin 1 TC and 1 regular tab
  • Restart firefox

But starts instantly for me.

The fact that you see the error "Timed out while waiting for Add-on to initialize" multiple times points to the fact that something is seriously wrong with your browser. You might want to try with a stable instead of an alpha version.

@MoscaDotTo
Copy link
Author

MoscaDotTo commented Sep 10, 2021

I am seeing the same behavior on a clean install and new profile on the latest stable (92.0)

image

I pinned three tabs: https://addons.mozilla.org/en-US/firefox/addon/temporary-containers/ (loads instantly but does not allow me to navigate away from amo until the other hung tabs have loaded)
https://www.mozilla.org/en-US/privacy/firefox/
https://www.google.com/

opened a new tab, closed the browser, reopened the browser and it hangs

@cpeterso
Copy link

Here is a Firefox bug report for a similar problem: https://bugzilla.mozilla.org/show_bug.cgi?id=1734947

The Temporary Container extension blocks all network requests until it is fully initialized. A Firefox engineer skimmed the extension's code and saw that the extension's initialization code is blocking all network requests while it is waiting to query open tabs (browser.tabs.query({})) and all other installed extensions (browser.management.getAll()).

Perhaps there is some initialization dependency between pinned tabs, blocked network requests, and session restore? And the deadlock is eventually broken when some long timeout expires?

@MoscaDotTo
Copy link
Author

https://bugzilla.mozilla.org/show_bug.cgi?id=1734947#c16

This is an architecture problem with the addon triggering this. We'll consider some UI to point out the problem to users, but we cannot address the problem in the addon.

@stoically
Copy link
Owner

@cpeterso

Thanks for the bug report pointer.

Perhaps there is some initialization dependency between pinned tabs, blocked network requests, and session restore? And the deadlock is eventually broken when some long timeout expires?

Correct. It's required to make sure that no "default container" tabs are loaded on startup.

However, the given error message is about the initialization of the Add-on as a whole timing out, not incoming requests. So actually the Add-on should not even be functional at all after that error.

@MoscaDotTo Please also see the latest comment on the bug report.

So I did disable that addon. The problem remains, but now I can't find any indicator in the UI that shows what's up.

Personally I have a bunch of pinned tabs and didn't encounter that issue yet.

@MoscaDotTo
Copy link
Author

I don't think pinned tabs are strictly related to the problem, based on the other comments. But disabling temporary containers addon fixes the problem for my profile

@stoically
Copy link
Owner

stoically commented Dec 4, 2021

Yeah. It seems that the mentioned Firefox API calls (bookmarks & tabs) might take a long time, which in this case is the root cause. TC is triggering the symptom, as it relies on those API calls to complete quickly, which they usually do. Though, I saw other issues here where similar odd-ish things happened, all related to Firefox API calls taking too long - and some combination of full Firefox re-install, sometimes even in combination with OS cleanup / re-install fixed it in the end. Because TC can't possibly do anything about Firefox API calls taking too long.

@MoscaDotTo
Copy link
Author

I see. Interesting that it's so inconsistent to reproduce. I guess I'll comment back if I ever pinpoint the exact cause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants