laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.75k stars 294 forks source link

octane:reload command doesn't reflect changes (swoole) #432

Closed michael-rubel closed 2 years ago

michael-rubel commented 2 years ago

Description:

octane:reload doesn't reflect changes with Swoole. The issue basically the same as this one or this one. octane:stop works correctly, but creates downtime.

Steps To Reproduce:

kevincobain2000 commented 2 years ago

Setup: CentOS 7/Apache

Yes, I have also noted the same issue. It doesn't reflect changes when new route/controller is added.

driesvints commented 2 years ago

Since this is about a specific distro on Linux that we don't use ourselves I'm afraid we can't provide support here. It works well on Ubuntu (the default distro on Forge). We'd very much welcome PR's that would run Octane on CentOS.

michael-rubel commented 2 years ago

@driesvints Looks like the issue isn't CentOS-related. It's something about the configuration cache and Octane's internal behavior. When I type the following:

php artisan optimize:clear
php artisan octane:reload

Then it works. If I add:

php artisan optimize:clear
php artisan optimize
php artisan octane:reload

Then the changes aren't applied.

And more! If I type:

php artisan route:clear
php artisan octane:reload

Changes are applied. Then:

php artisan route:cache
php artisan octane:reload

The changes before route:clear are reverted. 😄

Perhaps Laravel takes the snapshot of the optimized config files from an existing Octane instance so we need a full restart to update the cache. Maybe it doesn't make sense to use configuration cache at all in the case of using Octane?