You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using DB::enableQueryLog() and DB::getQueryLog() to record queries in a request and later process them(automatically find duplicate queries and others). But when I tried to integrate octane, I found that the queries are kept in a array between octane requests. Octane should clear this array after each requests to prevent memory leaks.
Reason
The array is defined in Illuminate/Database/Connection.php#L148, as the Database connection is reused between octane requests, the array on the object is never cleared.
Possible Solution
Maybe octane can call DB::flushQueryLog() after each request? [ For simplicity I am assuming only one connection is used ]
Run composer install && cp .env.example .env && touch database/database.sqlite && php artisan migrate. The project is set up to use sqlite as DB driver by default for testing convenience.
Run php artisan octane:start to start the server and then visit the homepage. After each refresh, you will see that the queries from all previous requests are also present. Also, the property database_connection_object_id in the response shows the current database connection object id which remains same.
The text was updated successfully, but these errors were encountered:
Description:
I was using
DB::enableQueryLog()
andDB::getQueryLog()
to record queries in a request and later process them(automatically find duplicate queries and others). But when I tried to integrate octane, I found that the queries are kept in a array between octane requests. Octane should clear this array after each requests to prevent memory leaks.Reason
The array is defined in Illuminate/Database/Connection.php#L148, as the Database connection is reused between octane requests, the array on the object is never cleared.
Possible Solution
Maybe octane can call
DB::flushQueryLog()
after each request? [ For simplicity I am assuming only one connection is used ]Steps To Reproduce:
composer install && cp .env.example .env && touch database/database.sqlite && php artisan migrate
. The project is set up to usesqlite
as DB driver by default for testing convenience.php artisan octane:start
to start the server and then visit the homepage. After each refresh, you will see that the queries from all previous requests are also present. Also, the propertydatabase_connection_object_id
in the response shows the current database connection object id which remains same.The text was updated successfully, but these errors were encountered: