-
Notifications
You must be signed in to change notification settings - Fork 381
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
Issue #5046: Prevent multiple data rebuild runs on module listing #3600
Conversation
Related to: backdrop/backdrop-issues#5046 |
Tugboat has finished building a preview for this pull request! Website: https://pr3600-ck7nzxtzxivt632vjzsdfjzvv7usukrh.tugboat.qa/ |
Website: http://3600.backdrop.backdrop.qa.backdropcms.org |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just tested this and works as expected. RTBC!
Will you re-launch PR, so it passed |
@alanmels, yes sure will. I didn't bother this morning, as I was short on time and if it runs into a timeout, it usually does again. 😏 |
Website: http://3600.backdrop.backdrop.qa.backdropcms.org Removed |
Tugboat has finished building a preview for this pull request! Website: https://pr3600-vc2yffkhhs6bbdpqwiouqsbcuucxucto.tugboat.qa/ |
Website: http://3600.backdrop.backdrop.qa.backdropcms.org |
Well, though, I'm still not sure this is a good idea. If we remove |
@docwilmot Data do get refreshed, the system module already takes care of that, the update module doesn't have to and shouldn't interfere on that page. My PR prevents the double rebuild call, but system_rebuild_module_data() still runs - but only once. |
The way I read this is as follows:
I could be wrong. |
@docwilmot why in the world should the system module on page /admin/modules - clearly only meant for modules - bother refreshing theme and layout stuff? |
I suspect we're misunderstanding each other. Summary: On certain paths Update module requires certain rebuild functions to run. It seems My statement "system module does not do all that" was in response to your statement that "data do get refreshed, the system module already takes care of that". System only does one of those rebuild processes, that is, it runs |
I suspect the same. 😏 Function system_rebuild_module_data() prevents stale data on the page that provides the ability to enable and disable modules. This page does not run any updates, nor does it handle layouts or themes. The only information needed there is recent info of all enabled/disabled modules. If you have any evidence, that something's actually missing, please clarify. |
@docwilmot, my understanding is that when visiting the As for:
we should really operate based not on guesses, but specific examples. I've run number of scenarios to trigger the Update module (such as deliberately downloading the older version of modules bot core and contributed modules) and seen no problem at all. If you give at least one of those certain paths, then I'm happy to run additional tests. But even in that unlikely scenario I would think it's a bug that needs to be fixed elsewhere. |
|
@docwilmot I see that. What I meant was give me one use case scenario when we would run on a real problem. When triggering the update function by placing the older versions of modules I didn't see any problems with stale data. Updates works just fine. Probably already present |
@docwilmot many thanks for that snippet from file update.compare.inc.
recompute the projects for update status That's why I explicitly mentioned in my previous comment, what data are necessary on /admin/modules. It doesn't run any updates. It's a form to enable or disable modules, that are already present. Another question: why should this be necessary on /admin/modules but not on /admin/modules/list? That's the same page. Wild guessing: back in 2010 or even earlier (git blame) someone thought, that the page /admin/modules also needs this, but they didn't verify if this is actually the case. Since then the page is slow (expensive code run twice). Almost twelve years later... maybe we can fix that mistake. But probably not today. Although I appreciate passionate discussions about code details - phew, I need a pause. And I assume, I'm not the only one. 😉 |
@docwilmot how about that: The system module should be the only one doing cache resets on that page, but... If the update module is turned on (module_exists), it does the same as the update module would do on that page, if it's not turned on it only runs the refresh as it currently does. The update module should do nothing with that page. That way we make sure that expensive code only runs once, but no stale data are around - even if this flushes a little more than page /admin/modules and /admin/modules/list actually need. The current culprit is that system_rebuild_module_data() runs twice - that's not hard to fix IMO. |
@indigoxela if we fix the static cache in |
@docwilmot if you insist on multiple calls (static cache fixed or not), I guess, we're stuck here. My branch has conflicts anyway, closing. |
Website: http://3600.backdrop.backdrop.qa.backdropcms.org Removed |
I think I have found the situation which explains why this line is there and what its intention is. Here is an example scenario:
The behavior changes at this point. Before this PR: The warning immediately goes away, because the comparison of available module versions versus installed versions is recalculated. How frequently would this actually be a problem? It would only occur if the administrator manually updated the module on disk, did not clear the caches before visiting /admin/modules, did not run update.php (perhaps if no run was needed), and did not load another page that still is in the list of pages that initiate rebuilds (such as Unfortunately, there's a pretty good chance that administrators will visit For now, I think keeping the intended behavior would be a good thing (the message should go away immediately), and we can fix the performance problem using @docwilmot's approach in #3601. Longer-term, I personally really dislike the way Update module yells at you all over the place. IMO the red dot in the admin bar and the big errors on the Available Updates page and the Status Report are sufficient. If we were to rework/remove these messages from other pages of the site, it would be an alternative way to save expensive processing when visiting the main admin pages. |
POC fo fix backdrop/backdrop-issues#5046
It prevents multiple runs of the rather expensive function system_rebuild_module_data() on the module listing page form.
On "admin/modules" the cache refresh, which should prevent stale data, is already handled by the system module.