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

Cache warmup SSH commands being executed multiple times per host #122

Open
adfinlay opened this issue Aug 4, 2020 · 2 comments · May be fixed by #123
Open

Cache warmup SSH commands being executed multiple times per host #122

adfinlay opened this issue Aug 4, 2020 · 2 comments · May be fixed by #123

Comments

@adfinlay
Copy link

adfinlay commented Aug 4, 2020

After updating to Symfony 4.4 and migrating to v2 of this gem I was reviewing deploy logs and noticed that the symfony:cache:warmup task was running the SSH command itself multiple times per server. I deploy to 9 servers, and the command looks like it's running 81 times, 9 per server.

The symfony_console call in that task is wrapped in an on:

https://github.com/capistrano/symfony/blob/master/lib/capistrano/tasks/symfony.rake#L31

Then the symfony_console function itself contains another on:

https://github.com/capistrano/symfony/blob/master/lib/capistrano/dsl/symfony.rb#L42

So it looks like it's saying "on each server, run the cache warmup command on each server". Am I misunderstanding this and I have a different issue? This explanation seems to fit the results I'm seeing.

@adfinlay adfinlay changed the title Cache clear SSH commands being executed multiple times per host Cache warmup SSH commands being executed multiple times per host Aug 4, 2020
@kissifrot
Copy link

Hello, this is indeed a bug, so either commit 5f0bf73 should be reverted or the additional on should be removed.

@adfinlay
Copy link
Author

adfinlay commented Aug 7, 2020

@kissifrot I think it would make more sense to revert the commit as opposed to removing the on from all of the places that symfony_console is called, as those make sense. IMO symfony_console is responsible for running the console and shouldn't concern itself with roles.

However, it would seem that "execute should be wrapped in an 'on' scope" so we may be stuck with removing the on scope from the call sites as your PR does.

csabavirag added a commit to unitedworldwrestling/capistrano-symfony that referenced this issue Jan 18, 2021
…le times when multiple servers are defined
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 a pull request may close this issue.

2 participants