Repository navigation
fix(symfony): reset the skolem IRI converter between requests - #8681
Open
silverbackdan wants to merge 1 commit into
Open
silverbackdan wants to merge 1 commit into
silverbackdan wants to merge 1 commit into
Conversation
SkolemIriConverter implements ResetInterface but its service was not tagged kernel.reset, so in long-running workers (FrankenPHP worker mode) its object map kept every object that received a genid IRI alive for the life of the worker.
Contributor
Author
|
Would you want any tests in here to harden it besides the simple assertion? Maybe it's worth thinking about having tests to make sure services extending |
This was referenced Oct 13, 2026
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.
Fix: #8680
I hit memory growth running API Platform under FrankenPHP worker mode and tracked it down to this.
SkolemIriConverteralready implementsResetInterface, but its service (api_platform.symfony.iri_converter.skolem) isn't taggedkernel.reset, soservices_resetternever callsreset()between requests. Its object → IRI map then keeps every object that got a/.well-known/genid/...IRI alive for the life of the worker.In one of our projects, an endpoint that returns a lot of embedded non-resource objects took a single worker to our 128M
memory_limitin about five requests. In our other apps it grows much more slowly (on our own metadata objects), which is probably why it hadn't shown up before.To reproduce: boot one kernel, handle the same request a few times, and call
services_resetter->reset()between them, as a worker does. With a response that embeds non-resource objects, the skolem map grows by the number of embedded objects on every request. With the tag, it's cleared each time and memory stays flat.The fix is the missing tag, plus an assertion in the extension test.