You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #44399 Prevent infinite nesting of lazy ObjectManager instances when ObjectManager is reset (Ocramius)
This PR was merged into the 4.4 branch.
Discussion
----------
Prevent infinite nesting of lazy `ObjectManager` instances when `ObjectManager` is reset
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
This patch ensures that the `ObjectManager` that the `Symfony\Bridge\Doctrine\ManagerRegistry`
replaces during `Symfony\Bridge\Doctrine\ManagerRegistry#resetService()` operations is a fresh
non-lazy service.
Before this change, `Symfony\Bridge\Doctrine\ManagerRegistry#resetService()` would replace the
initialization of the lazy proxy with a new service each time, but that service being lazy, this
led to an additional proxy nesting level at each service reset call. That leads to general
issues around memory reliability, stack trace nesting (and therefore bigger logged traces) and
potentially even stack overflow problems, when running with XDebug.
The problem seems to only apply when the `symfony/dependency-injection` `Container` is compiled
as a set of small factory files: that's because each generated factory has a boolean flag that
indicates whether a lazy or non-lazy version of a service is requested, as introduced in the
original implementation at #7890
Commits
-------
770425c Prevent infinite nesting of lazy `ObjectManager` instances when `ObjectManager` is reset
0 commit comments