Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Mailer] Fix Sendmail memory leak#59256
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 has been minimized.
This comment has been minimized.
@@ -114,7 +114,7 @@ protected function doSend(SentMessage $message): void | |||
$this->stream->setCommand($command); | |||
$this->stream->initialize(); | |||
foreach ($chunks as $chunk) { | |||
$this->stream->write($chunk); | |||
$this->stream->write($chunk, false); |
nicolas-grekasJan 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
For next reviewers: this sets the debug flag, so that the stream instance doesn't keep a string copy of what was written.This debug info is not accessible anywhere anyway.
That's similar to:
https://github.com/rch7/symfony/blob/c74e2a3d7e1df817b2bea7d8f6a8fc3373c445bb/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L222
Thank you@rch7. |
8d5be07
intosymfony:6.4Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Previous PR:#59239
Fixes issue#50486 (Sendmail transport runs out of memory).
So for example if you have loop sending personalized emails to 200,000 subscribers 20 kB each, $this->debug becomes 4 GB, plus overhead, and the script runs out of resources.
The fix eliminates the problem.