Skip to content

Doctrine left in non-operable state when used with Swoole/FrankenPHP #51661

Closed
@henderkes

Description

@henderkes

Symfony version(s) affected

Description

Running Symfony with a long-running runtime that leaves worker threads alive, such as swoole, roadrunner and frankenphp regularly leads to exceptions being thrown when fetching many entities (~100) with doctrine, every few requests.

The roadrunner bundle addresses this with a doctrine orm/odm middleware: https://github.com/Baldinof/roadrunner-bundle/blob/3.x/src/Integration/Doctrine/DoctrineORMMiddleware.php#L22

and there's also a bundle specifically for this issue here: https://github.com/pixelfederation/doctrine-resettable-em-bundle (which doesn't appear to work for FrankenPHP).

I've brought this up in the FrankenPHP repository but since Symfony tries to officially support these runtimes, it should probably be fixed here.

How to reproduce

Unfortunately I do not have a minimal example to reproduce this issue yet, but it is well known about and a way to fix it has been linked above.

If necessary, I can create a reproducer next week.

Possible Solution

https://github.com/Baldinof/roadrunner-bundle/blob/3.x/src/Integration/Doctrine/DoctrineORMMiddleware.php#L22

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions