Skip to content
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

Moodle: MySQL connection times out under HHVM, but not Zend #2957

Closed
csvan opened this issue Jun 17, 2014 · 1 comment
Closed

Moodle: MySQL connection times out under HHVM, but not Zend #2957

csvan opened this issue Jun 17, 2014 · 1 comment

Comments

@csvan
Copy link

csvan commented Jun 17, 2014

Environment
Ubuntu 14.04
HHVM 3.1 (from repo)
PHP 5.5.9
MySQL 5.5
Moodle 2.8 dev

Scenario

Set up test environment (http://docs.moodle.org/dev/PHPUnit).

Run the following test class:
https://github.com/moodle/moodle/blob/master/question/engine/tests/questionusage_autosave_test.php

by executing:

vendor/bin/phpunit --debug question_usage_autosave_test question/engine/tests/questionusage_autosave_test.php

Do the above both for PHP and HHVM.

Outcome
Tests pass fine under PHP in reasonable time (11 seconds on my machine). Running under HHVM takes several minutes and eventually crashes due to the database connection timing out. See output for both runtimes below:

PHP

Starting test 'question_usage_autosave_test::test_autosave_then_display'.
Starting test 'question_usage_autosave_test::test_autosave_then_autosave_different_data'.
Starting test 'question_usage_autosave_test::test_autosave_then_autosave_same_data'.
Starting test 'question_usage_autosave_test::test_autosave_then_autosave_original_data'.
Starting test 'question_usage_autosave_test::test_autosave_then_real_save'.
Starting test 'question_usage_autosave_test::test_autosave_then_real_save_same'.
Starting test 'question_usage_autosave_test::test_autosave_then_submit'.
Starting test 'question_usage_autosave_test::test_autosave_and_save_concurrently'.
Starting test 'question_usage_autosave_test::test_concurrent_autosaves'.
Starting test 'question_usage_autosave_test::test_autosave_with_wrong_seq_number_ignored'.
Starting test 'question_usage_autosave_test::test_finish_with_unhandled_autosave_data'.
Time: 11.11 seconds, Memory: 61.25Mb

HHVM

Starting test 'question_usage_autosave_test::test_autosave_then_display'.
Starting test 'question_usage_autosave_test::test_autosave_then_autosave_different_data'.
Starting test 'question_usage_autosave_test::test_autosave_then_autosave_same_data'.
Starting test 'question_usage_autosave_test::test_autosave_then_autosave_original_data'.
Starting test 'question_usage_autosave_test::test_autosave_then_real_save'.
Starting test 'question_usage_autosave_test::test_autosave_then_real_save_same'.
Starting test 'question_usage_autosave_test::test_autosave_then_submit'.
Starting test 'question_usage_autosave_test::test_autosave_and_save_concurrently'.
.
Starting test 'question_usage_autosave_test::test_concurrent_autosaves'.
SlowTimer [51966ms] at runtime/ext_mysql: slow query: DELETE FROM phpunit_question_attempt_steps 
E
Starting test 'question_usage_autosave_test::test_autosave_with_wrong_seq_number_ignored'.
SlowTimer [50446ms] at runtime/ext_mysql: slow query: DELETE FROM phpunit_question_attempt_steps 
E
Starting test 'question_usage_autosave_test::test_finish_with_unhandled_autosave_data'.
SlowTimer [50786ms] at runtime/ext_mysql: slow query: DELETE FROM phpunit_question_attempt_steps 
ESlowTimer [50996ms] at runtime/ext_mysql: slow query: DELETE FROM phpunit_question_attempt_steps 

Fatal error: Uncaught exception 'dml_write_exception' with message 'Error writing to database (Lock wait timeout exceeded; try restarting transaction
DELETE FROM phpunit_question_attempt_steps 
[array (
)])' in /home/christopher/sandbox/moodle/lib/dml/moodle_database.php:446
Stack trace:
#0 /home/christopher/sandbox/moodle/lib/dml/mysqli_native_moodle_database.php(1423): moodle_database->query_end()
#1 /home/christopher/sandbox/moodle/lib/dml/moodle_database.php(1829): mysqli_native_moodle_database->delete_records_select()
#2 /home/christopher/sandbox/moodle/lib/testing/classes/util.php(629): moodle_database->delete_records()
#3 /home/christopher/sandbox/moodle/lib/phpunit/classes/util.php(269): testing_util::reset_database()
#4 /home/christopher/sandbox/moodle/lib/phpunit/classes/util.php(130): phpunit_util::reset_database()
#5 /home/christopher/sandbox/moodle/lib/phpunit/classes/advanced_testcase.php(449): phpunit_util::reset_all_data()
#6 /home/christopher/sandbox/moodle/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(760): advanced_testcase::tearDownAfterClass()
#7 /home/christopher/sandbox/moodle/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php(350): PHPUnit_Framework_TestSuite->run()
#8 /home/christopher/sandbox/moodle/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(176): PHPUnit_TextUI_TestRunner->doRun()
#9 /home/christopher/sandbox/moodle/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run()
#10 /home/christopher/sandbox/moodle/vendor/phpunit/phpunit/composer/bin/phpunit(63): PHPUnit_TextUI_Command::main()
#11 {main}
@csvan csvan changed the title Moodle: MySQL connection times out under HHVM, but not PHP Moodle: MySQL connection times out under HHVM, but not Zend Jun 17, 2014
@lexidor lexidor mentioned this issue Sep 21, 2019
@lexidor
Copy link
Contributor

lexidor commented Jun 2, 2020

I am going over old issues on this repository, to see which ones apply to the current versions of hhvm.

This issue applies to running php code on hhvm. Hhvm nolonger supports running php code since hhvm version 4.0.0.

Moodle is a PHP application.

@lexidor lexidor closed this as completed Jun 2, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants