Solid Queue worker is shutdown after approx 1 minute

I have cofigured a Rails app web service and a Solid Queue worker service sharing a single database service along the following lines:

databases:
  - name: my-db
    plan: free

services:
  - type: web
    name: my-api
    runtime: ruby
    plan: starter
    buildCommand: ./bin/render-build.sh
    startCommand: "bundle exec rails server"
    healthCheckPath: /up
    envVars:
      - key: DATABASE_URL
        fromDatabase:
          name: my-db
          property: connectionString
      - key: WEB_CONCURRENCY
        value: 2
  - type: worker
    name: my-queue
    runtime: ruby
    plan: starter
    buildCommand: bundle install
    startCommand: bundle exec rake solid_queue:start
    envVars:
      - key: DATABASE_URL
        fromDatabase:
          name: my-db
          property: connectionString

However, although both the Rails app and the Solid Queue worker start up OK, the worker shuts down approximately 1 minute after a deployment:

==> Your service is live 🎉
==> Running 'bundle exec rake solid_queue:start'
[SolidQueue] Starting Dispatcher(pid=97, hostname=srv-co6st3en7f5s739c6t50-7fd94c8c74-xr7dw, metadata={:polling_interval=>1, :batch_size=>500, :concurrency_maintenance_interval=>600, :recurring_schedule=>nil})
[SolidQueue] Starting Worker(pid=100, hostname=srv-co6st3en7f5s739c6t50-7fd94c8c74-xr7dw, metadata={:polling_interval=>0.1, :queues=>"*", :thread_pool_size=>3})
[SolidQueue] Terminating gracefully...

Am I missing something…?

Someone reported a very similar problem here. Unfortunately they didn’t post the solution. :pensive:

On further investigation, it looks as if the process is still running after all. I now suspect that the “Terminating gracefully…” message relates to the process started by the previous deployment. I’m going to mark this as solved.

Hi there,

This is correct. Zero downtime deploys mean the old worker will shutdown after the new worker starts up. This log is the old worker shutting down. This doesn’t show well in our dashboard logs, but if you use a log stream, you will see this log came from the old instance id.

Regards,

Keith
Render Support, UTC+10 :australia: