-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
High CPU usage stuck in infinite loop of LoadMore waiting for isFullyLoaded #533
Comments
Hm, that's quite surprising; do you see any error logs when this happens? Normally if loading fails, an error should be printed to the console. It might be convenient to look at the console in the full-tab view, but here's how to access the console for the sidebar: https://github.com/josh-berry/tab-stash/wiki/Collect-Error-Logs I do see a bug that could cause Tab Stash to retry too fast when things fail, but that doesn't explain why it's trying to load bookmarks multiple times to begin with. |
Nothing at all in the console, neither the extension one nor Firefox main console (I should've mentioned that). I'm not setup for any serious debugging of extensions but if there's something you want me to look into I can give it a shot. Is there any reason you don't have a backoff delay instead of immediately waiting for the next idle tick? |
I do; it turns out it's buggy and doesn't work as intended. 🤦 I will work on fixing it for the next release.
Hm, so one thing I'm wondering is: does the "+" character in the count of tabs/groups in the search box ever go away? e.g. Does it always say "Search NNN+ groups, MMM+ tabs" or does it eventually change to "Search NNN groups, MMM tabs"? If the "+" never goes away, that suggests to me that there is something amiss in your bookmarks DB itself; exporting and re-importing all your bookmarks might make the problem go away (though I'd still like to understand why it happened in the first place, heh). If the "+" goes away fairly quickly (or doesn't appear at all), but the high CPU persists, that suggests a problem in the UI itself unrelated to bookmarks, maybe something peculiar to Firefox on Linux, or your Firefox setup in particular. (I will say I've tried to reproduce this on Linux myself, unsuccessfully, under Kubuntu with a fresh/unconfigured copy of Firefox.) |
The '+' appears then disappears quickly once everything has loaded. I synced my firefox to a Windows machine and cannot reproduce the issue there (with all the same extensions etc, minus the 1000+ bookmarks). I'll try to export-import the bmarks and see if that solves it (but seems unlikely from your comment). |
Okay, thanks. That tells me enough that, after spending some quality time reading the code, I think I have a pretty good theory about what's happening now. It's not even related to the backoff (though I need to fix that too)--basically there is a corner case where we are stuck in an infinite loop doing nothing even after the folder has been loaded. Unfortunately there is not a workaround for this, so I'll try to get a release done as soon as possible. (If you are feeling adventurous enough to help test, it's not that hard, I can point you at the instructions once I land the fix. And you'll get the fix that much faster. :) ) I am still really curious why you're hitting it consistently on Linux and nowhere else. (And why I've not been able to get it to reproduce on Linux either.)
|
If the `<load-more>` component is unmounted while it is loading, AND while `is-fully-loaded="false"`, the loader function will get stuck in an infinite loop. Stop the loader from running by explicitly noting the component is no longer visible when it is unmounted.
I've pushed a fix (I hope). If you'd like to try it out without waiting for a release (which might take a bit), here's how to build Tab Stash yourself and get it running in your browser: https://github.com/josh-berry/tab-stash/blob/master/docs/contributing.md#getting-started No worries if you don't want to spend time/energy on this, of course, but if you do want to try it out, it would be helpful to know if the fix works for you or not. (I also did fix the exponential-backoff issue separately, fwiw, though it wouldn't have mattered here.) |
I imported all my bmarks into a new profile with no other ext installed - same issue, in fact worse, CPU is at 20%! (my current setup sits at about 6-10%). I'll try your fix soon if time permits, busy week - but thank you for actioning this so quickly :). |
No problem, thanks for taking the time to collect the profiles and dig into it a bit—I wouldn't have been able to push a fix so quickly without your help doing that work up front. :) |
I'm going to go ahead and close this since I need to get a release out soon, but do let me know if you're still seeing the issue once the release lands. Thanks again! |
Hi @josh-berry, fix confirmed! Thanks again :) |
Great, I’m glad to hear it! Thanks for letting me know! |
OS Version
Linux
Browser Version
Firefox 130
Tab Stash Version
3.1
Number of Open Tabs
1
Number of Stashed Tabs
11
Total Number of Bookmarks
1000
Performance Profile Link
https://share.firefox.dev/4etNSB3, https://share.firefox.dev/4e91P7L
Installed Extensions
Numerous but none that conflict (I don't know an easy way to get the full list, and don't think it matters - let me know if you really need it).
Problem Description
High CPU usage even with a handful of stashed tabs.
Profiler shows tab stash is spinning inside a loop waiting for
isFullyLoaded
which is never set true.Steps to Reproduce
Nothing, just being idle with the sidebar or stash tab open (and active).
Impact
Tried restarting, reinstalling, clearing etc. Bogs down FF and makes pages laggy and in extreme cases unresponsive.
This only happens when either the side-bar or tabstash-tab is open - if the tab is open but isn't active then CPU drops to <1%.
One workaround is to toggle the visibility but I prefer to always see the side-bar as I use it frequently. Apart from the context-switch and visual jitter, toggling the side-bar is slow as tabstash reloads all the bookmarks each time which takes about 2sec to finish, which is a huge disruption of flow.
Additional Details
I thought maybe I have too many tabs stashed but after reinstalling the extension and reducing the number of stashed tabs to <10 the profile shows the same issue (though of course it gets much worse with 100+ tabs).
Vote for This Issue
The text was updated successfully, but these errors were encountered: