Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
bootstrap system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Nov 2014 at 17:19 UTC
Updated:
18 Aug 2016 at 11:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
thomasdik commentedComment #3
niklanConfirm, same problem.
Comment #4
nikolay shapovalov commentedConfirm, same problem.
Comment #5
othermachines commentedAdded link to related issue.
Comment #6
marcelovaniI cannot reproduce the problem, can you give steps?
Comment #7
marcelovaniI have a situation where an empty string is passed as parameter $name, which causes some extra loops for no reason.
See a proposed fix here https://www.drupal.org/node/2383823#comment-9385897
Comment #8
jeroen.b commentedHere's a patch to at least put a warning in watchdog when it can't find a file in the db (and thus executes a full recursive file scan). Since 7.33 a missing file might be a performance killer for your site.
See my blog post (http://www.vdmi.nl/blog/i-went-drupal-733-and-all-i-got-was-slow-site) and some discussion in #2228825 for more information.
Comment #9
joelpittetI tested the patch in #8 and it indeed found some things I need to look into.
Changing the issue to 7.x-dev as that is where the patch will be applied.
Comment #10
joelpittetCould we "quote" the values so they don't run in the sentance and maybe include the
$filevariable for more context?Comment #11
joelpittetnm #10 about the $file because it's empty all the time "", but quoting the values would help.
I noticed that in my screenshot all those cases are due to omega's excludes in my theme info file:
Comment #12
joelpittetMoving those to standard hook_css_alter() and hook_js_alter() with unset()s seemed to help that out.
Really rough xhprof before and after diff:
Also note that this sluggish feeling seems to be only after a page cache clear and those watchdog warnings won't show up (for me anyway) without clearing the page cache. So both runs were after a page flush cache.
Comment #13
jeroen.b commentedI'll change the patch to include quotes later (or maybe to 'Bootstrap could not locate file "@name.@type" in the database.'?), but maybe we should think of some better solution here?
The sluggish feeling only after cache clear is probably because it caches the result.
When you use module_load_include, it doesn't cache the result, so it's sluggish on every request (and even killing when it's a site with much traffic).
Comment #14
joelpittetMaybe we can setup a patch to profile and prove the slowness.
A few broken paths to files. One patch with and without the change from the previously issue.
Then we can run xhprof kit on them both.
@see https://www.drupal.org/contributor-tasks/profiling
Comment #15
joelpittetNow I'm really curious how modifying a module's css/js has anything to do with loading the module...
Comment #16
joelpittetOh because I'm calling drupal_get_path('module', 'field_group') in the css alter hook...
Comment #17
joelpittetPlease Ignore my crazy talk in #15 and #16. It's true I think just a bit unrelated to the task at hand.
Comment #18
marcelovaniI think this issue it related and could have the fix for the problem
https://www.drupal.org/node/1081266#comment-6874620
The concept is to cache the data, avoiding re-doing the job more than once.
It also outputs a message when a module is not found.
This issue is 2 years old and I think it is time to see if we can get it committed.
Comment #19
jeroen.b commentedComment #20
David_Rothstein commentedI'm adding a note about this to the 7.33 release notes.
Comment #21
pandapowder commentedI found this via the release notes so thanks for that. I'm testing now in a test environment and I'm seeing the full file system scan being triggered for orphan module records in the system table.
deleting the orphan records prevents the log messages (and performance problem) but is that safe? The first couple I found were custom modules we've developed (and since removed), but then I found commerce_coupon_ui which is apparently left over from Commerce Coupons 1.x. Is it safe to delete records from that table if the module doesn't exist in the filessytem and does anyone know why they would still be there?
delete from system where name in ('commerce_coupon_ui');Does anyone know if this is because of some quirk in my site's history, or is orphaned records a known issue? Thanks.
Comment #22
jenlampton@pandaPowder The orphaned records you are seeing are probably there because you forgot to disable the module (you may have just removed the files from your site.) If you put back commerce_coupon_ui, disable it (and uninstall for good measure) then the problem should be resolved.
If commerce_coupon_ui is part of commerce_coupon and you are still using it, I would open an issue in that queue referencing this problem. Perhaps all that's needed is an update or uninstall hook :)
Comment #23
lorique commentedAdding patch for resetting to how it was before, for those of us who prefer to avoid the regression until a true fix is added.
Comment #24
jeroen.b commented@lorique
See: https://www.drupal.org/node/1081266#comment-9411015 for a D7 patch
Comment #25
lorique commented@jeroen.b
Yeah i saw it, and prefer to reset to the old ways until its reviewed and tested by smarter people than I, and put into core. This is purely because the site was working fine with it before, so it can continue to until a sure fix is in.
Comment #26
David_Rothstein commentedI said something similar at #1081266-204: Avoid re-scanning module directory when a filename or a module is missing but maybe trigger_error() is better than watchdog() here. It would get the message into watchdog too, but also would display it on the screen on dev sites which would be a good thing for a bug like this.
Comment #27
robcolburn commentedHow about?
In that way we keep the old (fast) logic, recognize the strangeness, complain to the log, and skip the bogus file exists check.
Comment #28
David_Rothstein commentedIs there anything left to do in this issue now that #1081266: Avoid re-scanning module directory when a filename or a module is missing is fixed?
Comment #29
dbassendine commentedThe patch in #8 (to flag missing files in watchdog) no longer applies cleanly to 7.50, and I suppose since #1081266 is now fixed this one is now resolved anyway?
Comment #30
fabianx commentedYes, lets close this one as a duplicate.