Last modified: 2014-09-25 17:47:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72843, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70843 - Fatal error, timeout when running composer install
Fatal error, timeout when running composer install
Status: RESOLVED FIXED
Product: MediaWiki-Vagrant
Classification: Unclassified
labs-vagrant (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Dan Duvall
: hhvm
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-15 13:33 UTC by Aude
Modified: 2014-09-25 17:47 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Aude 2014-09-15 13:33:47 UTC
when running composer install to get fresh install of Wikibase, I get fatal error due to timeout.

Fatal error: Maximum execution time of 180 seconds exceeded in phar://composer.phar/bin/../src/../src/Composer/Util/ErrorHandler.php on line 36
Comment 1 Aude 2014-09-15 16:49:15 UTC
despite in the php.ini settings:

; http://vanderveer.be/speed-up-composer-by-using-hhvm-including-a-slowtimer-error-fix/                
hhvm.resource_limit.socket_default_timeout = 300                                                       
hhvm.http.slow_query_threshold = 300000 

the timeout still appears to be 180 seconds.
Comment 2 Dan Duvall 2014-09-15 18:02:07 UTC
I believe the threshold for script execution is controlled by 'max_execution_timeout' which still seems to be set at 180. [1]

vagrant@mediawiki-vagrant:~$ php -r 'var_dump(ini_get("max_execution_time"));'
string(3) "180"

We _could_ change this globally for all php script, however considering this limit can easily be overridden at runtime it seems more like something that should be handled by composer itself.

[1] http://docs.hhvm.com/manual/en/info.configuration.php#ini.max-execution-time
Comment 3 Bryan Davis 2014-09-15 18:11:38 UTC
(In reply to Dan Duvall from comment #2)
> I believe the threshold for script execution is controlled by
> 'max_execution_timeout' which still seems to be set at 180. [1]
> 
> vagrant@mediawiki-vagrant:~$ php -r
> 'var_dump(ini_get("max_execution_time"));'
> string(3) "180"
> 
> We _could_ change this globally for all php script, however considering this
> limit can easily be overridden at runtime it seems more like something that
> should be handled by composer itself.
> 
> [1]
> http://docs.hhvm.com/manual/en/info.configuration.php#ini.max-execution-time

I think this is a bug in hhvm actually. Read that documentation link you gave and you'll see that php5-cli defaults to "0" for this as can be seen with the php5 binary:

$ php5 -r 'var_dump(ini_get("max_execution_time"));'
string(1) "0"
Comment 4 Dan Duvall 2014-09-15 18:31:10 UTC
(In reply to Bryan Davis from comment #3)
> I think this is a bug in hhvm actually. Read that documentation link you
> gave and you'll see that php5-cli defaults to "0" for this as can be seen
> with the php5 binary:

AFAICT there's no bug. We're explicitly setting it to 180 on the first line of /etc/hhvm/php.ini which affects the execution limit in all contexts. Remove that line and you get the expected value of 0 from the command line.

You're right though, I should have read more closely. Since the default for CLI is 0 we probably shouldn't be messing with it. It looks like we may be able to move that setting to /etc/hhvm/server.ini. [1] Does that seem reasonable (if it works)?

[1] https://github.com/facebook/hhvm/wiki/INI-Settings
Comment 5 Bryan Davis 2014-09-15 19:24:55 UTC
(In reply to Dan Duvall from comment #4)
> (In reply to Bryan Davis from comment #3)
> > I think this is a bug in hhvm actually. Read that documentation link you
> > gave and you'll see that php5-cli defaults to "0" for this as can be seen
> > with the php5 binary:
> 
> AFAICT there's no bug. We're explicitly setting it to 180 on the first line
> of /etc/hhvm/php.ini which affects the execution limit in all contexts.
> Remove that line and you get the expected value of 0 from the command line.

The bug it is the difference in behavior between php and hhvm. Php5 ignores any ini setting for max-execution-time when executing in cli mode. You can see this by checking /etc/php5/cli/php.ini on your MW-Vagrant VM or a production host. "max_execution_time = 30" is included in that file, but the CLI SAPI entry point will ignore it and give the unlimited result when queried. This behavior is documented a little more clearly at <http://php.net/manual/en/features.commandline.differences.php> than it is on the ini settings page.


> You're right though, I should have read more closely. Since the default for
> CLI is 0 we probably shouldn't be messing with it. It looks like we may be
> able to move that setting to /etc/hhvm/server.ini. [1] Does that seem
> reasonable (if it works)?
> 
> [1] https://github.com/facebook/hhvm/wiki/INI-Settings

We can probably work around the problem by making changes to bring the hhvm configuration used in MW-Vagrant into sync with the configuration that has been done for production <https://github.com/wikimedia/operations-puppet/blob/production/modules/hhvm/manifests/init.pp>.
Comment 6 Dan Duvall 2014-09-15 19:49:21 UTC
(In reply to Bryan Davis from comment #5)
> The bug it is the difference in behavior between php and hhvm. Php5 ignores
> any ini setting for max-execution-time when executing in cli mode. You can
> see this by checking /etc/php5/cli/php.ini on your MW-Vagrant VM or a
> production host. "max_execution_time = 30" is included in that file, but the
> CLI SAPI entry point will ignore it and give the unlimited result when
> queried. This behavior is documented a little more clearly at
> <http://php.net/manual/en/features.commandline.differences.php> than it is
> on the ini settings page.

Got it! That's some seriously obscure behavior.

> > You're right though, I should have read more closely. Since the default for
> > CLI is 0 we probably shouldn't be messing with it. It looks like we may be
> > able to move that setting to /etc/hhvm/server.ini. [1] Does that seem
> > reasonable (if it works)?
> > 
> > [1] https://github.com/facebook/hhvm/wiki/INI-Settings
> 
> We can probably work around the problem by making changes to bring the hhvm
> configuration used in MW-Vagrant into sync with the configuration that has
> been done for production
> <https://github.com/wikimedia/operations-puppet/blob/production/modules/hhvm/
> manifests/init.pp>.

That definitely seems like the best longterm approach, but should we maybe just remove the setting for now?
Comment 7 Dan Duvall 2014-09-15 19:55:15 UTC
Scratch that last question. I'll just go ahead and Do the Right Thing (tm). It looks easy enough to refactor.
Comment 8 Gerrit Notification Bot 2014-09-16 00:14:14 UTC
Change 160571 had a related patch set uploaded by Dduvall:
Split HHVM php.ini into common and fcgi hiera settings

https://gerrit.wikimedia.org/r/160571
Comment 9 Gerrit Notification Bot 2014-09-25 17:45:49 UTC
Change 160571 merged by Dduvall:
Split HHVM php.ini into common and fcgi hiera settings

https://gerrit.wikimedia.org/r/160571

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links