Got a MySQL Process that appears to be stuck
It’s not uncommon for Rails specs to kill our database in development. It appears that if a browser spec doesn’t close cleanly you can end up with processes just hanging and so the next spec run will just wait forever.
Here’s the process list. It’s sleeping on the job.
MariaDB [(none)]> SHOW PROCESSLIST;
+-----+-------+-----------------+------------+---------+------+----------+------------------+----------+
| Id | User | Host | db | Command | Time | State | Info | Progress |
+-----+-------+-----------------+------------+---------+------+----------+------------------+----------+
| 357 | painy | localhost:52732 | painy_test | Sleep | 563 | | NULL | 0.000 |
| 358 | painy | localhost:52733 | NULL | Sleep | 565 | | NULL | 0.000 |
| 363 | painy | localhost:53036 | painy_test | Sleep | 384 | | NULL | 0.000 |
| 364 | painy | localhost:53037 | NULL | Sleep | 436 | | NULL | 0.000 |
| 381 | robl | localhost | NULL | Query | 0 | starting | SHOW PROCESSLIST | 0.000 |
+-----+-------+-----------------+------------+---------+------+----------+------------------+----------+
5 rows in set (0.000 sec)sql
Probably just best to kill these processes and get on with our lives.
MariaDB [(none)]> KILL 357;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> KILL 363;
Query OK, 0 rows affected (0.000 sec)sql