Closed girinabin closed 3 weeks ago
This is likely a configuration issue (MySQL client timeout shorter than the server timeout that) that have been mitigated in the Symfony Doctrine bridge.
If you use Symfony with Doctrine, be sure to use the dev version of the bundle, which has this patch https://github.com/doctrine/DoctrineBundle/pull/1739
Otherwise, you'll have to create a similar Doctrine listener, or better, fix the configuration.
Closing as there is nothing we can do in FrankenPHP itself regarding this issue. This should be handled by Doctrine.
What happened?
I'm running FrankenPHP in worker mode with Doctrine ORM. I encountered an issue where, after manually closing the database connection (by bringing down the MySQL service with docker-compose down and then bringing it back up with docker-compose up), some requests start failing with a "There is no active transaction" exception. Other requests pass successfully, but the error continues for 4-5 requests before stabilizing.
This issue seems related to how FrankenPHP's worker mode handles database connections, as connections are shared across requests. Manually resetting the entity manager after detecting this error only partially mitigates the issue, as it persists for a few more requests.
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
Relevant log output