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

Octane does not call close() on Monolog Handler #850

Closed
NiroDeveloper opened this issue Mar 13, 2024 · 2 comments
Closed

Octane does not call close() on Monolog Handler #850

NiroDeveloper opened this issue Mar 13, 2024 · 2 comments

Comments

@NiroDeveloper
Copy link
Contributor

Octane Version

2.3.4

Laravel Version

10.46.0

PHP Version

8.1.27

What server type are you using?

Swoole

Server Version

5.1.2

Database Driver & Version

No response

Description

Laravel uses Monolog for logging, some monolog handler have a important close() function.
Octane does never call this function! In normal laravel applications, monolog calls close by itself via __destruct().
It seams like __destruct() is never called in Swoole and it could be sensible to call close() after every request.

Taking into account that there is currently only one workaround to write performant logs: #724 (comment)
In this case the ProcessHandler::close() is never called and laravel will spawn endless cat processes.

Steps To Reproduce

  1. Create an endpoint that writes information to the Log facade
  2. Create a log driver that requires an close() call, like in Logging in requests is very slow #724 (comment)
  3. Run linux ps and see that for every request a cat process was created but not closed.
@NiroDeveloper
Copy link
Contributor Author

@driesvints This is a different problem then #724, this could also generate problems while using other monolog handlers like StreamHandler, SocketHandler or SyslogHandler.

Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

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

No branches or pull requests

2 participants