Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.8k
[DoctrineBridge] Allow doctrine_ping_connection to ping all connections#62788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:8.1
Are you sure you want to change the base?
Conversation
nicolas-grekas commentedDec 19, 2025
But why? I mean: if there's no name configured, the default entity manager is used. So why ping should care about any others if it doesn't use them? |
fpondepeyre commentedDec 19, 2025
@nicolas-grekas Thanks for taking a look at the MR and for the question! Even when no manager name is configured, the middleware runs before the handler and doesn’t actually know which EntityManager the handler will use. In multi‑EM apps, handlers can inject a non‑default EM (e.g. reporting/archive). If only the default is pinged, those other connections can still be stale and you can hit “connection gone away” even though the middleware ran. Pinging all managers in the “no name configured” case makes the default behavior safer for multi‑EM setups, while preserving the existing behavior for people who explicitly configure a single manager (they still only ping that one). That said, if you prefer “default‑only unless explicitly configured”, it’s a reasonable position and I understand if the change is rejected on that basis. |
The middleware DoctrinePingConnectionMiddleware now pings every registered EntityManager when no specific manager name is configured, instead of only the default one. Each closed manager is
reset using its own name so multi-connection setups don’t leave zombie connections. Added tests covering multi-manager pinging and targeted reset (not run locally because phpunit dependencies
couldn’t be fetched without network access).