Details
-
Bug
-
Resolution: Fixed
-
High
-
3.8.8, 3.9.2
-
None
-
Operating System: Linux
PHP Version: (please be specific, like '4.4.3' or '5.1.5'): 4.4.4
Database and version: MySQL 4.1.14
Description
For reasons still unknown to me MySQL keeps closing connection every now and then.
Query error: MySQL server has gone away. Query: UPDATE ezsession SET expiration_time='<timestamp>', data=<data>' WHERE session_key='<key>'
These messages ends up in /var/log/error.log instead of /ezp-root/var/log/error.log. To see these messages do the following:
$ touch /var/log/error.log $ chown <apache user> /var/log/error.log
In lib/ezdb/classes/ezmysqldb.php, if no result from the query is returned query() assumes something went wrong and calls $this->unlock(); which again calls $this->query();. If something wrongs happens while executing $this->unlock() it will be called again! This infinite loop will eventually cause Apache to crash with a "Segmentation Fault".
There are numerous reasons why MySQL might close the connection, some which might be eZP faults:
"You tried to run a query after closing the connection to the server. This indicates a logic error in the application that should be corrected."
However most of them is related to hosting environment and/or MySQL: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html