Conditionally start sidekiq-cluster named Sidekiq
When configuring Sidekiq to run in cluster mode, using
sidekiq['cluster'] = true
, we would previously start up a service
called sidekiq-cluster
. This might be confusing to administrator, as
the service they configured is sidekiq
rather than
sidekiq-cluster
.
This changes that behaviour, if sidekiq-cluster was started using the new configuration:
sidekiq['enable'] = true
sidekiq['cluster'] = true
Then the service that will run sidekiq-cluster will be called
sidekiq
rather than sidekiq-cluster
Configuring sidekiq-cluster using the soon-to-be deprecated configuration
sidekiq_cluster['enable'] = true
would still result in a service called sidekiq-cluster
.
It is not possible to start sidekiq-cluster twice with conflicting
configuration. So we know when node['gitlab']['sidekiq']['cluster']
is set and sidekiq_cluster
is enabled that this will be the only
sidekiq-cluster process that will be started.
Demo of the configuration on a test instance: https://stuff.vanlanduyt.co/file/dropstuff/cluster-process-naming-gQNcCz2Ene5Vw9wQZcZrF9rFVNWU6G.mov