Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't happen on every request, only on subsequent ones. I have a calendar page traversing a lot of information from different entities with OneToMany relations. Every ~5-10 page visits, php throws a fatal error (typically Fatal Error, Nesting level too deep, recursive dependency?, but sometimes other ones). After reload, it's good for 5-10 visits again and so on.
(I know, I shouldn't use Doctrine for read-only purposes, but efficiency isn't terribly important as the requests still finishes in under 100ms)

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it would be nice to provide a workaround for that in the docs while it's not fixed upstream.
I'm pretty sure that registering a custom Symfony listener that will call
ping()and/or reset the Doctrine connection before using it would fix the issue.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've linked a fix in the issue. You can use the bundle, or just copy-paste the middleware into your own project.
https://github.com/Baldinof/roadrunner-bundle/blob/3.x/src/Integration/Doctrine/DoctrineORMMiddleware.php
Although, to be honest, I'm not sure why this fixes the issue with doctrine randomly causing bogus php error messages. The memory leak related to doctrine was already fixed sometime in the last months.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dunglas do you want to try and document the workaround before merging this PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DubbleClick I think that the Doctrine error is triggering another bug in Symfony Error Handler... Would be nice to investigate this one too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to investigate that further in the past, but it didn't really lead anywhere. What prevented the error was limiting the amount of entities I loaded with doctrine. What would be a bug in the Symfony error handler regarding this? That it still renders parts of the template before the crash?