-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Doctrines event subscriber out of memory. #28010
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
Comments
Can confirm the issue. Until its resolved you could temporarily mark your EventSubscriber diff --git a/composer.json b/composer.json
index 49746b5..4dd4ca4 100644
--- a/composer.json
+++ b/composer.json
@@ -15,6 +15,7 @@
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "^4.1",
+ "symfony/proxy-manager-bridge": "^4.1",
"symfony/security-bundle": "^4.1",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
diff --git a/config/services.yaml b/config/services.yaml
index f98bd4e..2075d09 100644
--- a/config/services.yaml
+++ b/config/services.yaml
@@ -33,3 +33,6 @@ services:
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
+
+ App\Event\EntitySubscriber:
+ lazy: true edit: ah it actually seems like just enabling lazy services in general (adding the proxy manager bridge) is already enough. |
Thanks for the reproducer. The cause of the issue is a circular reference when proxy-manager-bridge is not installed: on 3.3, this is detected at runtime and leads to On 3.4 & up, this circular reference is undetected and turns to an infinite loop. |
Oh, I see. In my 3.3 project I have an installed I have try on new install sf3.3. If there is migrations-bundle - no error, otherwise Anyway installing |
that's because |
…ptions or infinite loops at runtime (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix false-positive circular ref leading to wrong exceptions or infinite loops at runtime | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28010, #27865 | License | MIT | Doc PR | - When circular loops involve references in properties, method calls or configurators, it is possible to properly instantiate the related services. The current logic is broken: `ContainerBuilder` considers some of these loops as self-referencing circular references, leading to a runtime exception, and in similar situations, `PhpDumper` generates code that turns to infinite loops at runtime 💥. These badly handled situations happen with inlined definitions. This PR fixes both classes by making them track which references are really part of the constructors' chain, including inline definitions. It also fixes dumping infinite loops when dumping circular loops involving lazy services while proxy-manager-bridge is not installed. Commits ------- e843bb8 [DI] Fix false-positive circular ref leading to wrong exceptions or infinite loops at runtime
Symfony version(s) affected: 4.*
Description
It worked in symfony 3.3 but it didn't work after update to symfony 4.1
How to reproduce
https://github.com/ln-e/symfony_out_of_memory
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: