EC-CUBE / EC-CUBE/ec-cube

メール送信時にメモリリーク

Open
#6,000 5 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
788
Forks
719
Avg merge
4d 16h
Merged PRs (30d)
37

Description

### 概要(Overview)

メールを大量に送信すると`Allowed memory size of * bytes exhausted`エラーが発生。

[MessageLoggerListener](https://github.com/symfony/mailer/blob/v5.4.17/EventListener/MessageLoggerListener.php#L43)で`MessageEvent`の参照を保持し続けることにより発生するが、これに依存しているprodのサービスは(少なくともEC-CUBE 4.2.1標準では)存在しない。

`MessageLoggerListener::reset()`を呼び出すことで参照はなくなる。

関連:
- https://github.com/symfony/symfony/issues/45211
- https://github.com/symfony/symfony/pull/37712

↓標準↓
![範囲を選択_287](https://github.com/EC-CUBE/ec-cube/assets/1329505/3845cbf4-c518-49cd-9579-ab5ef7b7e5bb)

↓`MessageLoggerListener::reset()`を利用した場合↓
![範囲を選択_286](https://github.com/EC-CUBE/ec-cube/assets/1329505/72e1abda-8d92-4731-b7bc-75eaef728ae1)

### 再現手順(Procedure)

メールを大量に送信する。

### 環境(Environment)

EC-CUBE: 4.2.1
PHP: 8.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.