Skip to content
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

[10.x] Fix memory leak from middlewares tempering request #49334

Conversation

pghiuzan
Copy link

Fixes #49333

@pghiuzan pghiuzan force-pushed the fix-memory-leak-from-middlewares-tempering-request branch from 9a2db6b to d2f733f Compare December 11, 2023 21:19
@taylorotwell
Copy link
Member

I think it depends on where you register these call backs. They should probably be registered within the register method of a service provider. That would typically only be invoked once even when running an application within Octane or the queue.

@pghiuzan
Copy link
Author

@taylorotwell Here's an updated example registering the callbacks within the register phase: pghiuzan/laravel-10-reproduce-memory-leak-from-middlewares-tempering-request@534911e. The problem is there even when running PHPUnit, not only Octane or queue workers.

A very similar result can be obtained by running tests on a Laravel instance with livewire/livewire:^3.2.6 installed.

@taylorotwell taylorotwell reopened this Dec 12, 2023
@crynobone crynobone changed the title Fix memory leak from middlewares tempering request [10.x] Fix memory leak from middlewares tempering request Dec 13, 2023
@WayneHarris
Copy link
Contributor

We encountered the same issue during an attempt to update Livewire 3.2 livewire/livewire#7181 and @bpotmalnik added a demo repo showing the issue livewire/livewire#7344 (comment)

@taylorotwell
Copy link
Member

Fixed here: bb49a72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible memory leak on middlewares tampering with the request
3 participants