Possible CPU race condition in Chromium based Browsers

OctoPrint 1.4.2
Python 2.7.16
OctoPi 0.17.0
PI 3B+
MK3S

Hello,
I am relatively new to Octoprint and I have noticed a browser side issue. If I am posting this in the wrong place or am missing crucial info please let me know. I've been noticing very high browser CPU usage (33% of system cpu on quad core laptop) when using Octoprint on W10 in Chrome 85.0.4183.102 (Official Build) (64-bit) and Edge Version 85.0.564.51 (Official build) (64-bit). This issue can occur in Octoprint safe mode with no camera attached and printer turned off. This issue seems to be related to the popup messaging system in Octoprint. The quickest way to duplicate the issue is to go into manage plugins and to quickly enable or disable several plugins and hit save. This will pop the you must restart message for every plugin you enable or disable. After about 10 seconds my CPU usage on my Octoprint tab hits 25-35% and stays there. Nothing I do at that point will reduce the CPU usage until I close the browser tab. This issue doesn't seem to happen in FireFox. I suspect a recursion issue within the browser messaging system of Octoprint.
Thanks, Paul
(Edited to correct typos)

This looks very similar to this issue, that was never officially confirmed being my plugin causing all the problems. Since you've been able to reproduce in safe mode that rules plugins out completely.

2 Likes

Should I post this in github?

When I was trying to duplicate the issue I was convinced it was plugin related since I was enable/disabling plugins, a screen full at a time to test the issue. After a number of tests I realized the issue had nothing to do with which plugins I was enabling/disabling but the fact that I was enabling/disabling plugins. Also the CPU usage problem happens BEFORE I restarted the Octoprint server after changing the plugin status. Can anyone try my procedure and confirm? Remeber, you must close the tab or browser between tests to clear the CPU usage problem.

If you think you have reliable reproduction steps, (which it seems you do) then by all means create a new issue. The worst that can happen is that no one else has the problem, it'll definitely get looked at (by me first, then probably Gina), if you fill out the whole template when you do it then it really helps for us to look into it.

1 Like

Will do, thanks!
FYI: Octoprint is an awesome tool, it has changed my whole relationship with my printer.
Cheers,
Paul

1 Like

I have posted on GitHub ( #3729) with more refined steps. @jnelillii Yes, there is a very significant memory leak associated with this issue. I saw 2gigs of ram used on one test.