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:reload command doesn't reflect changes (swoole) #432

Closed
michael-rubel opened this issue Dec 5, 2021 · 3 comments
Closed

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

michael-rubel opened this issue Dec 5, 2021 · 3 comments

Comments

@michael-rubel
Copy link

michael-rubel commented Dec 5, 2021

  • Octane Version: v1.0.20
  • Laravel Version: v8.73.2
  • PHP Version: v8.1.0
  • Server & Version: Swoole v4.8.2
  • Database Driver & Version: MariaDB v10.6.4

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:

  • Set up Octane on CentOS 7 with Nginx and Supervisor:
[program:octane]
command=/usr/bin/php -d variables_order=EGPCS /var/www/project/artisan octane:start --server=swoole --host=0.0.0.0 --port=8000 --max-requests=10000
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=youruser
stdout_logfile=/var/www/project/storage/logs/octane-workers.log
stopwaitsecs=60

Change something in the project, then run the octane:reload command from youruser.

@kevincobain2000
Copy link
Contributor

kevincobain2000 commented Dec 6, 2021

Setup: CentOS 7/Apache

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

@driesvints
Copy link
Member

driesvints commented Dec 6, 2021

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
Copy link
Author

michael-rubel commented Dec 6, 2021

@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?

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

No branches or pull requests

3 participants