Skip to content

Resettable services called on repeatable boot kernel, not on terminate event #16806

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrew-demb opened this issue May 16, 2022 · 2 comments
Closed
Labels
DependencyInjection hasPR A Pull Request has already been submitted for this issue. HttpKernel

Comments

@andrew-demb
Copy link
Contributor

https://symfony.com/doc/5.4/reference/dic_tags.html#kernel-reset

During the kernel.terminate event, Symfony looks for any service tagged with the kernel.reset tag to reinitialize their state. This is done by calling to the method whose name is configured in the method argument of the tag.

If you will check the codebase about services_resetter (main service with all known services tagged as kernel.reset) callers - you will find, that it is called only on kernel 2+ booting (if we talking about HTTP context)
https://github.com/symfony/symfony/blob/9cb6274a5bcfddea10f84369acfe7f480a9c7d1f/src/Symfony/Component/HttpKernel/Kernel.php#L113-L125

Should the documentation be updated about the moment, when reset method will be called?

@vudaltsov
Copy link
Contributor

Agree, documentation is really misleading at the moment. @javiereguiluz , may I attract your attention to this issue?

@xabbuh
Copy link
Member

xabbuh commented Feb 3, 2023

Are you up for a PR that rewords the current description?

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DependencyInjection hasPR A Pull Request has already been submitted for this issue. HttpKernel
Projects
None yet
Development

No branches or pull requests

3 participants