I have a drupal site with advagg 7.x.2.17 on server A and on server B I have a cronjob where I do:

ssh SERVER_A_IP -p 22 drush -r /web-pub/site pm-disable readonlymode -y
ssh SERVER_A_IP -p 22 drush -r /web-pub/site pm-enable readonlymode -y

The enable of readonlymode takes more than 60 seconds and I get:

Fatal error: Maximum execution time of 60 seconds exceeded in /web-pub/site/sites/all/modules/contrib/features/features.export.inc on line 1090

Nowhere in my code I have set a limit of 60 seconds. In fact, I've set it to 6000 seconds.

I recursively grepped my whole site on server A using:

grep -r --include "*.php" --include "*.inc" "max_exe" /web-pub/site/ | grep 60

and I only got:

/web-pub/site/sites/all/modules/contrib/advagg/advagg_css_compress/yui/CSSMin.inc:        $this->max_execution_time = 60; // 1 min

I changed that 60 to 61. Next time my cron job on server B run I got the error:

Fatal error: Maximum execution time of 61 seconds exceeded in /web-pub/site/sites/all/modules/contrib/features/features.export.inc on line 0

So, it seems that the limit that is leaking outside of that module originates from advagg's CSSMin code.

I don't know why enabling a third party module (in this case readonlymode) initiates code in the advagg, but the fact that advagg doesn't honour the time limit I've explicitly set in my settings.php seems like a problem to me.

Comments

ioannis.cherouvim created an issue. See original summary.

ioannis.cherouvim’s picture

Issue summary: View changes
ioannis.cherouvim’s picture

Issue summary: View changes
akz’s picture

Subscribing

meltoner’s picture

Subscribing - this is terrible !

mariaioann’s picture

Indeed, it seems to be a bug.

smamalis’s picture

Subscribing

mikeytown2’s picture

Thanks for finding that. I'll see what I can do later on today. Expect a patch in less than 12 hours.

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new921 bytes

Here's a patch. When running from the command line the timeout is usually 0 (unlimited); looking at the code it doesn't take this into account and assumes that 60 is higher than 0 in this case.

  • mikeytown2 committed 4821a88 on 7.x-2.x
    Issue #2762639 by mikeytown2: CSSMin.inc max_execution_time 60 leaks...
mikeytown2’s picture

Status: Needs review » Fixed

Committed this.
Created a pull request for this as well
https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/pull/31

Status: Fixed » Closed (fixed)

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