[GH-8410] Fix memory leak in new toIterable and state bug.#8467
Merged
beberlei merged 6 commits intodoctrine:2.8.xfrom Feb 16, 2021
Merged
[GH-8410] Fix memory leak in new toIterable and state bug.#8467beberlei merged 6 commits intodoctrine:2.8.xfrom
beberlei merged 6 commits intodoctrine:2.8.xfrom
Conversation
This was referenced Feb 8, 2021
Closed
simPod
previously approved these changes
Feb 8, 2021
snapshotpl
previously approved these changes
Feb 8, 2021
The new AbstractQuery::toIterable() had a memory leak that AbstractQuery::iterable() did not have. This leak is now fixed. After fixing the leak, one test failed where the identity map in ObjectHydrator triggered and lead to a notice. Introduced a new AbstractHydrator::cleanupAfterRowIteration() that the ObjectHydrator uses to cleanup the state.
When multiple entity results are part of a row, the result handling must be different. In addition mixed results with scalars are broken and now throw an exception as illegal operation.
094453c to
b5f740c
Compare
Do we have a follow-up fix for this or an issue tracking it? |
Contributor
|
I created an issue (#8520) to at least track the problem this PR introduced. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The new AbstractQuery::toIterable() had a memory leak that AbstractQuery::iterable() did not have. This leak is now fixed.
After fixing the leak, one test failed where the identity map in ObjectHydrator triggered and lead to a notice. Introduced a new AbstractHydrator::cleanupAfterRowIteration() that the ObjectHydrator uses to cleanup the state.
When the result contains multiple entities, there must be special handling, otherwise only the last entity is returned.
In addition mixed result queries with scalar mappings don't work with iteration and are now explicitly prevented by exception.
Fixes #8410 Fixes #8413 Fixes #8387
Supersedes #8412 #8414