8000 [Mailer] Fix memory leak with `mailer.message_logger_listener` by andrew-demb · Pull Request #60515 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Mailer] Fix memory leak with mailer.message_logger_listener #60515

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

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
from

Conversation

andrew-demb
Copy link
Contributor
@andrew-demb andrew-demb commented May 22, 2025
Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #50580
License MIT

Register mailer.message_logger_listener only when profiler enabled to prevent memory leaks as suggested in:

@stof can you guide me about the way how to implement your second suggestion too? #50580 (comment)

This change may be considered as a minor BC break - DI service won't be available anymore with disabled profiler.

@carsonbot carsonbot added this to the 7.3 milestone May 22, 2025
@carsonbot carsonbot changed the title 📦 [#50580] Memory leak with mailer.message_logger_listener [Mailer] 📦 [#50580] Memory leak with mailer.message_logger_listener May 22, 2025
@OskarStark OskarStark changed the title [Mailer] 📦 [#50580] Memory leak with mailer.message_logger_listener [Mailer] Fix memory leak with mailer.message_logger_listener May 22, 2025
…hen profiler enabled to prevent memory leaks
@@ -4,6 +4,7 @@ CHANGELOG
7.3
---

* `mailer.message_logger_listener` now registered in DI only when profiler enabled to prevent memory leaks
Copy link
Contributor
@OskarStark OskarStark May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed if this is considered a bugfix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether it is a bugfix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... because solution is about to dropping service from DI container when profiler is disabled

@andrew-demb
Copy link
Contributor Author

CI failure is unrelated

1) Symfony\Component\HttpClient\Tests\AmpHttpClientTest::testNonBlockingStream
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'<1>'
+''

/home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Tests/HttpClientTestCase.php:128

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.

[Mailer] Memory leaking when sending many emails
3 participants
0