featherbb / featherbb

FeatherBB is a simple and lightweight forum system written in PHP, using Slim Framework for a proper OOP-MVC architecture
https://featherbb.org
47 stars 10 forks source link

ORM delete user from online_table hanging #26

Closed peloyeje closed 9 years ago

peloyeje commented 9 years ago

\ORM::for_table($this->db->prefix.'online')->where('ident', get_remote_address())->delete_many();’ is hanging, but I was not able to debug it by myself ... Still a newbie :)

Here's the trace

#0 /var/www/public/featherbb/include/idiorm.php(445): PDOStatement->execute()
#1 /var/www/public/featherbb/include/idiorm.php(2348): ORM::_execute('DELETE FROM `on...', Array, 'default')
#2 /var/www/public/featherbb/model/login.php(103): ORM->delete_many()
#3 /var/www/public/featherbb/controller/login.php(91): model\login->logout('2', '2fbba3d13c292c6...')
#4 [internal function]: controller\login->logmeout('2', '2fbba3d13c292c6...')
#5 /var/www/public/featherbb/Slim/Route.php(173): call_user_func_array(Array, Array)
#6 [internal function]: Slim\Route->Slim\{closure}('2', '2fbba3d13c292c6...')
#7 /var/www/public/featherbb/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#8 /var/www/public/featherbb/Slim/Slim.php(1358): Slim\Route->dispatch()
#9 /var/www/public/featherbb/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#10 /var/www/public/featherbb/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#11 /var/www/public/featherbb/Slim/Extras/Middleware/CsrfGuard.php(51): Slim\Middleware\MethodOverride->call()
#12 /var/www/public/featherbb/Slim/Middleware/PrettyExceptions.php(67): Slim\Extras\Middleware\CsrfGuard->call()
#13 /var/www/public/featherbb/Slim/Slim.php(1303): Slim\Middleware\PrettyExceptions->call()
#14 /var/www/public/featherbb/index.php(37): Slim\Slim->run()
#15 {main}
adaur commented 9 years ago

That's embarassing... when did you get this bug? (ie: connected as admin/user/guest ?)

What is the full error message ?

peloyeje commented 9 years ago

Connected as admin, here's the full log :

Details

Type: PDOException
Code: HY000
Message: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
File: /var/www/public/featherbb/include/idiorm.php
Line: 445
Trace

#0 /var/www/public/featherbb/include/idiorm.php(445): PDOStatement->execute()
#1 /var/www/public/featherbb/include/idiorm.php(2348): ORM::_execute('DELETE FROM `on...', Array, 'default')
#2 /var/www/public/featherbb/model/login.php(103): ORM->delete_many()
#3 /var/www/public/featherbb/controller/login.php(91): model\login->logout('2', '2fbba3d13c292c6...')
#4 [internal function]: controller\login->logmeout('2', '2fbba3d13c292c6...')
#5 /var/www/public/featherbb/Slim/Route.php(173): call_user_func_array(Array, Array)
#6 [internal function]: Slim\Route->Slim\{closure}('2', '2fbba3d13c292c6...')
#7 /var/www/public/featherbb/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#8 /var/www/public/featherbb/Slim/Slim.php(1358): Slim\Route->dispatch()
#9 /var/www/public/featherbb/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#10 /var/www/public/featherbb/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#11 /var/www/public/featherbb/Slim/Extras/Middleware/CsrfGuard.php(51): Slim\Middleware\MethodOverride->call()
#12 /var/www/public/featherbb/Slim/Middleware/PrettyExceptions.php(67): Slim\Extras\Middleware\CsrfGuard->call()
#13 /var/www/public/featherbb/Slim/Slim.php(1303): Slim\Middleware\PrettyExceptions->call()
#14 /var/www/public/featherbb/index.php(37): Slim\Slim->run()
#15 {main}

Can you reproduce it in your environment ?

adaur commented 9 years ago

It never happened to me, strange.

Maybe we should close the connection https://github.com/j4mie/idiorm/issues/153

adaur commented 9 years ago

Can you try this?

https://github.com/featherbb/featherbb/commit/92fc3e4c7851dc431e4ecba0f1aa557f1f1bc4c8

peloyeje commented 9 years ago

Same ...

adaur commented 9 years ago

Hm, what is your setup (database, web server...) ? If I could reproduce this, maybe I could come up with a solution.

peloyeje commented 9 years ago

I'm running the Scotch Box with vagrant, https://box.scotch.io. It's a pretty usual set up, with Apache, PHP 5.6 and MySQL. How can I be of help ?

adaur commented 9 years ago

Maybe you could try this https://openclassrooms.com/forum/sujet/fermer-une-connexion-avec-pdo-14874#message-7924182