Description
Description
Currently, the Doctrine connection can get pinged on each new message if the middleware is enabled. But, the message handlers can be very heavy and timeouts short (for example, default wait_timeout
on Azure MySQL is 180s).
If you have a very heavy handler, the handler execution process might be longer than the idle timeout and, once the handler completes, ack()
can throw an MySQL has gone away
error even though the connection was pinged successfully when the message was received.
The suggestion is to basically incorporate this https://twitter.com/lyrixx/status/1575127719624544258 into DoctrinePingConnectionMiddleware (or in a more appropriate place).
/cc @lyrixx
Example
- new message
- ping connection, valid
- run handler, it does a bunch of stuff (say, 3rd party APIs, etc)
- 5min later...
ack()
fails withMySQL has gone away
,SSL: Connection reset by peer
or similar error
This change would ensure the connection is "exercised" during the handler execution window too.