Skip to content

[Mailer] Added the missing reset tag to mailer.logger_message_listener #37705

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

Merged

Conversation

vudaltsov
Copy link
Contributor

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets no
License MIT
Doc PR

@fabpot
Copy link
Member

fabpot commented Jul 30, 2020

Thank you @vudaltsov.

@fabpot fabpot merged commit e69b8b1 into symfony:4.4 Jul 30, 2020
@vudaltsov vudaltsov deleted the mailer-logger-message-listener-reset-tag branch July 30, 2020 11:41
fabpot added a commit that referenced this pull request Aug 2, 2020
… env=prod (vudaltsov)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Mailer] Prevent MessageLoggerListener from leaking in env=prod

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| License       | MIT

I was trying to send a batch of emails with `--env=prod` when I noticed that `MessageLoggerListener` was still collecting all the messages and leaking the memory. I tried to do `$this->getApplication()->reset()`, but it didn't work because `MessageLoggerListener` was not tagged (now fixed in #37705).

In this PR I propose to move the declaration of `MessageLoggerListener` to `mailer_debug.php` since the only service depending on it is `mailer.data_collector` from `mailer_debug.php`. If a developer needs to collect sent emails, a custom listener could be implemented on the project side.

- [x] deprecate the service
- [x] add a new one to `mailer_debug.php`
- [ ] add a line to CHANGELOG.md
- [ ] add a line to UPGRADE-5.2.md

Commits
-------

e226775 [Mailer] Prevent MessageLoggerListener from leaking in env=prod
This was referenced Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants