Skip to content

fix(symfony): tag SkolemIriConverter with kernel.reset - #8676

Open
KarlComSe wants to merge 1 commit into
api-platform:5.0from
KarlComSe:fix/skolem-iri-converter-kernel-reset-5.0
Open

KarlComSe wants to merge 1 commit into
api-platform:5.0from
KarlComSe:fix/skolem-iri-converter-kernel-reset-5.0

Conversation

@KarlComSe

Copy link
Copy Markdown
Q A
Branch? 5.0
Tickets follow-up to #7829
License MIT
Doc PR n/a

#7829 made SkolemIriConverter implement ResetInterface, but the api_platform.symfony.iri_converter.skolem service is not tagged kernel.reset, so Symfony's services_resetter never calls reset(). In a long-running worker (FrankenPHP) the converter's objectHashMap keeps every serialized DTO of every previous request: about 0.5 MB per request for a 200-DTO response, measured on 4.4.4, unchanged by #7829. The Laravel variant already calls reset() (a RequestHandled listener in ApiPlatformProvider, #7838).

This adds the tag. The test is in ApiPlatformExtensionTest::testSkolemIriConverterIsResetBetweenRequests: it fails without the tag (Tag "kernel.reset" not found on the service "api_platform.symfony.iri_converter.skolem") and passes with it. The same service definition is on 4.4 and main.

api-platform#7829 made SkolemIriConverter implement ResetInterface, but the service
definition is not tagged, so Symfony's services_resetter never calls
reset() and the object map keeps growing in long-running workers.

Tag the service and assert the tag in the extension test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant