Problem/Motivation

In the event that {system} reports a module being enabled, and that module is removed from the filesystem improperly, _advanced_help_parse_ini begins a file_scan_directory of "./", including one's entire "files" directory. Symptoms: admin/modules page takes forever to load or times-out if there is a large directory tree within the docroot.

I believe this can be reproduced by:
1. Install & Enable Advanced Help and Devel
2. Place huge directory tree in sites/default/files
3. delete Devel from the filesystem without disabling it
4. Visit admin/modules - the larger the tree in sites/default/files, the longer the page load will be

Proposed resolution

The attached patch checks to see that $module_path is something before attempting any operations with it. If $module_path is not found, it reports the offending module to watchdog.

Remaining tasks

Needs review

User interface changes

None.

API changes

None known.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

petsagouris’s picture

Status: Active » Needs review
JacobSingh’s picture

To reproduce this, you could symlink from your files directory to the / (root) of your system causing a massive directory scan.

andershal’s picture

I have another fix for what I think is the same problem.

The Drupal 7 version of advanced_help uses the old Drupal 6 file_scan_directory() parameters. Therefore there is a complete recursive traversing through all folders of our multisite setup - including all files!

Patch for branch 7.x-1.x attached.

budda’s picture

We've found the same problem this week. Good to see we're not alone with the file_scan_directory() parameters observation!

mikebell_’s picture

Status: Needs review » Reviewed & tested by the community

Tested patch from comment 3 and it works well.

budda’s picture

Priority: Normal » Major

Agreed - patch in comment 3 fixed the problem. Tested and deployed to the production server and no more recursion on the server!

amitgoyal’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all!! Moved into 7.x-1.x-dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.