-
-
Notifications
You must be signed in to change notification settings - Fork 449
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix desynchronized entity managers after kernel reset #1118
Fix desynchronized entity managers after kernel reset #1118
Conversation
7d8f315
to
561af7f
Compare
This is what I was going to propose. This also fixes a large performance regression seen in tests and probably |
I'm not entirely happy with this because reset semantics are in bridge and we are now working around that here. If these semantics are wrong, it should be changed there. All we should ideally do is just call resetService, without conditionals on our side. That said, it's our fault for causing breaks and symfony team is ignoring the issue, so we must do it on our side, at least until they fix it. |
In some scenarios involving long running processes and proxies, resetting the entity manager results in a creation of a new entity manager, while some services still hold a reference to the old one, which keeps its previous state. This abandons resetting the entity manager in favor of a call to clear() on the existing entity manager if it is open. Fixes doctrine#1112
561af7f
to
7c6f6ed
Compare
Merging this as it definitely fixes the duplicated service issue we've been experiencing. We're still discussing how to proceed with other breaks introduced by resetting the manager. Thanks @ostrolucky! |
Thanks @ostrolucky, this should be enough :) We also merged a check in php-pm to not clear the EM if the Registry already implements the |
Fixes #1114
We can't reset because of this symfony/symfony#35216 + performance issues, so let's just do clear() so it works for long running processes (same thing php-pm does for years).