-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Open
Description
Symfony version(s) affected
7.3.x
Description
Let's assume you're not using Doctrine as your Messenger transport, but you are using Doctrine ORM.
The latest alarm based features added by @HypeMC in #53533 and #53508 provided a way to refresh the transports, and this got expanded to Doctrine too in #59601.
But, the Doctrine middleware is does not honor this and Doctrine will only get refreshed by the alarm if you're using Doctrine as your Messenger transport too.
Example:
- use Beanstalk (or any other transport except Doctrine) as your Messenger transport
- use Doctrine ORM as usual, enable the middleware
- message comes in, Doctrine middleware runs to refresh the connection
- processing the message takes say 10min
- the alarm keeps triggering and the Beanstalk connection is getting refreshed, but not Doctrine's
- before the message is processed, the end result needs to be written into the DB, but the database connection is closed by the server due to 10min idle (it was refreshed on message arrival)
How to reproduce
See above.
Possible Solution
If you've enabled the Doctrine middleware, it should get triggered by the alarm too.
Additional Context
Technically, the original intent of #47920 was not solved.