Skip to content

Attempting to shut down the service on app roll servers causes deploys to fail #4

@bashcoder

Description

@bashcoder

Thanks very much for this plugin - super helpful.

In the file /lib/capistrano/tasks/solid_queue.rake most of the tasks are limited to the :solid_queue_role which defaults to :db. However, the quiet task runs on the role :app.

Even though it seems to be configured to not complain on failure with raise_on_non_zero_exit: false my production deploy task fails to complete, because on the app servers that are not in the :db group return this error:

DEBUG [74797850] Command: /usr/bin/env /bin/systemctl --user kill -s SIGTERM supershop_solid_queue_production
DEBUG [c3ecd6da]       Failed to kill unit supershop_solid_queue_production.service: Unit supershop_solid_queue_production.service not loaded.

I am running Amazon Linux 2023 and using rvm.

Everything works fine for me if I change :app to fetch(:solid_queue_role) in this part of the code linked below. Is there a reason that this runs on all servers instead of just the :db role, or is this just a bug?

desc "Quiet solid_queue (start graceful termination)"
task :quiet do
on roles(:app) do
plugin.execute_systemd("kill", "-s", "SIGTERM", fetch(:solid_queue_service_unit_name), raise_on_non_zero_exit: false)
end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions