Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
0bbe5a2 to71b44feComparestof commentedMay 5, 2023
Do we also have the issue for lazy ghosts or no ? |
tucksaun commentedMay 5, 2023
Good question. I would say it should be. But let me check that later on today |
nicolas-grekas commentedMay 5, 2023
Thank you@tucksaun. |
tucksaun commentedMay 5, 2023
Confirmed, the object was a lazy ghost when I encountered this issue |
If one happens to have a service that is configured to be lazy AND also implements
ResetInterface, when Symfony resets resettableService, it will callreseton 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 as
LazyObjectInterfaceand has not been initialized (ie not used yet)