Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Prevent initialising lazy services during services reset#50241

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@tucksaun
Copy link
Contributor

QA
Branch?6.2
Bug fix?yes-ish
New feature?no
Deprecations?no
Ticketsnone
LicenseMIT
Doc PR

If one happens to have a service that is configured to be lazy AND also implementsResetInterface, when Symfony resets resettableService, it will callreset on the service which will trigger the initialization even though the service has not been actually used by the code, which defeats the purpose of having the service lazy.
To fix this I propose to skip resetting a service that is marked asLazyObjectInterface and has not been initialized (ie not used yet)

@carsonbotcarsonbot added this to the6.2 milestoneMay 4, 2023
@tucksauntucksaun changed the title[HttpKernel] Prevent initialising lazy services when reseting them[HttpKernel] Prevent initialising lazy services during services resetMay 4, 2023
@tucksaun

This comment was marked as resolved.

@tucksauntucksaunforce-pushed thefix/lazy-services-reset branch from0bbe5a2 to71b44feCompareMay 4, 2023 20:59
@stof
Copy link
Member

stof commentedMay 5, 2023

Do we also have the issue for lazy ghosts or no ?

@tucksaun
Copy link
ContributorAuthor

Do we also have the issue for lazy ghosts or no ?

Good question. I would say it should be. But let me check that later on today

@nicolas-grekas
Copy link
Member

Thank you@tucksaun.

@nicolas-grekasnicolas-grekas merged commitf1af316 intosymfony:6.2May 5, 2023
@tucksauntucksaun deleted the fix/lazy-services-reset branchMay 5, 2023 16:46
@tucksaun
Copy link
ContributorAuthor

Do we also have the issue for lazy ghosts or no ?

Good question. I would say it should be. But let me check that later on today

Confirmed, the object was a lazy ghost when I encountered this issue

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

4 participants

@tucksaun@stof@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp