We have a customer using a cheap managed hosting provider, and their MySQL server very aggressively times out and drops the connection.

I wonder if this could be causing us troubles as outlined here: Massive template cache cleaning tasks always get stuck

Does Craft attempt to reconnect to MySQL if the connection drops halway through a request?


If a MySQL connection drops in the middle of a request, then that will either cause a PHP fatal error (that will end the request entirely) or cause an exception to be thrown.

If the exception isn't handled, then the request will end as well. If it is caught, it can be gracefully handled and the request can continue. The remaining part of the request might attempt a new database connection, but it will not attempt to re-execute the SQL on the previously dropped MySQL connection. It has moved on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.