Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Prevent MessageLoggerListener from leaking in env=prod#37712
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
[Mailer] Prevent MessageLoggerListener from leaking in env=prod#37712
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fabpot commentedJul 31, 2020
What's the problem keeping it in prod (now that it does not leak memory anymore)? |
vudaltsov commentedJul 31, 2020
At first I had a hypothesis that If that's not the case, then why it is there when no other service depends on it? Obviously DI cannot automatically remove And yes, it's still leaking without calling I also founda comment by@nicolas-grekas :
This PR can help to accomplish this goal 😉 |
fabpot commentedJul 31, 2020
Not using something in core does not mean that we should remove it. |
nicolas-grekas commentedAug 1, 2020
(please mind the test failure) |
dadb3fb toe226775Comparefabpot commentedAug 2, 2020
Thank you@vudaltsov. |
vudaltsov commentedAug 2, 2020
@fabpot , should I add a changelog entry? |
Uh oh!
There was an error while loading.Please reload this page.
I was trying to send a batch of emails with
--env=prodwhen I noticed thatMessageLoggerListenerwas still collecting all the messages and leaking the memory. I tried to do$this->getApplication()->reset(), but it didn't work becauseMessageLoggerListenerwas not tagged (now fixed in#37705).In this PR I propose to move the declaration of
MessageLoggerListenertomailer_debug.phpsince the only service depending on it ismailer.data_collectorfrommailer_debug.php. If a developer needs to collect sent emails, a custom listener could be implemented on the project side.mailer_debug.php