Skip to content

Start Solid Queue with bin/jobs and remove solid_queue:quiet - #16

Merged
burisu merged 1 commit into
mainfrom
bin-jobs-and-drop-quiet
Nov 9, 2026
Merged

burisu merged 1 commit into
mainfrom
bin-jobs-and-drop-quiet

Conversation

@burisu

@burisu burisu commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Aligns the gem with Solid Queue 1.7.2, after reading its README and source.

Changes

  • The service starts Solid Queue with bin/jobs, the only start command Solid Queue documents, instead of rake solid_queue:start (which still exists in 1.7.2 but isn't documented). ExecStart=<bundle command> exec bin/jobs. The application needs bin/jobs: Rails 8 applications have it, and bin/rails solid_queue:install creates it.
  • solid_queue:quiet is removed. Solid Queue has no quiet mode: TERM starts a graceful shutdown (supervisor/signals.rb), which solid_queue:stop already does. In async mode, a shutdown that exceeds shutdown_timeout ends with exit! (async_supervisor.rb:48, exit code 1), which Restart=on-failure would restart after a systemctl kill (read in the code, not run). No hook calls the task since Fix install, uninstall and status, drop reload and the quiet hook, clean up the gem #15.
  • README: the application needs bin/jobs; the gem isn't needed when Solid Queue runs inside Puma with plugin :solid_queue (both would start a supervisor); bin/jobs options can be passed through Solid Queue's SOLID_QUEUE_* environment variables, which bin/jobs without flags reads (configuration.rb:158-165).
  • CHANGELOG: Unreleased entries.

Checked on a Rails 8.1 application with Solid Queue 1.7.2

Generated with rails new (SQLite, separate queue database), RAILS_ENV=production:

  • /usr/bin/env bundle exec bin/jobs (the new ExecStart): the launched process becomes the fork supervisor (same PID, solid-queue-fork-supervisor(1.7.2)), so systemd tracks the right main process; after TERM, "Supervisor terminated gracefully" and exit code 0. bundle exec rake solid_queue:start behaves the same.
  • Through asdf, as a unit generated with capistrano-asdf would run it, in an emptied environment with PATH=/usr/bin:/bin: asdf exec bundle exec bin/jobs runs the supervisor on the asdf Ruby (~/.asdf/installs/ruby/4.0.6/bin/ruby), no error in the log, exit code 0 after TERM.
  • Not changed after checking: on this application, db:migrate alone creates the 13 solid_queue_* tables of a fresh queue database, so capistrano-rails' default migration_command is enough there. Rails 7.1/7.2 and PostgreSQL weren't tried.

Tests

  • test_service_starts_solid_queue_with_bin_jobs and the --tasks test (no solid_queue:quiet) failed before the change.
  • The quiet test in :system mode, which covered passing raise_on_non_zero_exit to sudo, becomes a status test in :system mode.
  • Mutation: removing the ExecStart= line, or the raise_on_non_zero_exit: option of backend.sudo, makes a test fail.
  • bundle exec rake (tests + standard): green locally (Ruby 4.0.6).

Upgrade

Run cap <stage> solid_queue:install again so the installed unit runs bin/jobs.

🤖 Generated with Claude Code

Revue d'alignement avec Solid Queue 1.7.2 :

- son README ne documente que bin/jobs pour démarrer ; l'unité lance
  maintenant « <bundle> exec bin/jobs » au lieu de « rake
  solid_queue:start ». Vérifié sur une application Rails 8.1 générée
  avec Solid Queue 1.7.2 : bin/jobs démarre le superviseur en mode fork
  dans le processus lancé (même PID), s'arrête proprement sur TERM avec
  le code 0, et tourne sous le Ruby d'asdf avec PATH=/usr/bin:/bin ;
- Solid Queue n'a pas de mode quiet : SIGTERM y déclenche un arrêt
  propre, et en mode async un arrêt qui dépasse shutdown_timeout finit
  par exit! (code 1), que Restart=on-failure relance. La tâche quiet,
  qu'aucun hook n'appelle plus, est supprimée. Le test de quiet en mode
  :system, qui vérifiait la transmission de raise_on_non_zero_exit à
  sudo, devient un test de status en mode :system ;
- README : l'application doit avoir bin/jobs, le gem ne sert pas si
  Solid Queue tourne dans Puma avec son plugin, et les options de
  bin/jobs se passent par les variables SOLID_QUEUE_*.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@burisu
burisu marked this pull request as ready for review November 9, 2026 10:53
@burisu
burisu merged commit eee2e50 into main Nov 9, 2026
5 checks passed
@burisu
burisu deleted the bin-jobs-and-drop-quiet branch November 9, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant