Repository navigation
Start Solid Queue with bin/jobs and remove solid_queue:quiet - #16
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns the gem with Solid Queue 1.7.2, after reading its README and source.
Changes
bin/jobs, the only start command Solid Queue documents, instead ofrake solid_queue:start(which still exists in 1.7.2 but isn't documented).ExecStart=<bundle command> exec bin/jobs. The application needsbin/jobs: Rails 8 applications have it, andbin/rails solid_queue:installcreates it.solid_queue:quietis removed. Solid Queue has no quiet mode:TERMstarts a graceful shutdown (supervisor/signals.rb), whichsolid_queue:stopalready does. Inasyncmode, a shutdown that exceedsshutdown_timeoutends withexit!(async_supervisor.rb:48, exit code 1), whichRestart=on-failurewould restart after asystemctl 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.bin/jobs; the gem isn't needed when Solid Queue runs inside Puma withplugin :solid_queue(both would start a supervisor);bin/jobsoptions can be passed through Solid Queue'sSOLID_QUEUE_*environment variables, whichbin/jobswithout flags reads (configuration.rb:158-165).Checked on a Rails 8.1 application with Solid Queue 1.7.2
Generated with
rails new(SQLite, separatequeuedatabase),RAILS_ENV=production:/usr/bin/env bundle exec bin/jobs(the newExecStart): the launched process becomes the fork supervisor (same PID,solid-queue-fork-supervisor(1.7.2)), so systemd tracks the right main process; afterTERM, "Supervisor terminated gracefully" and exit code 0.bundle exec rake solid_queue:startbehaves the same.PATH=/usr/bin:/bin:asdf exec bundle exec bin/jobsruns the supervisor on the asdf Ruby (~/.asdf/installs/ruby/4.0.6/bin/ruby), no error in the log, exit code 0 afterTERM.db:migratealone creates the 13solid_queue_*tables of a freshqueuedatabase, so capistrano-rails' defaultmigration_commandis enough there. Rails 7.1/7.2 and PostgreSQL weren't tried.Tests
test_service_starts_solid_queue_with_bin_jobsand the--taskstest (nosolid_queue:quiet) failed before the change.quiettest in:systemmode, which covered passingraise_on_non_zero_exittosudo, becomes astatustest in:systemmode.ExecStart=line, or theraise_on_non_zero_exit:option ofbackend.sudo, makes a test fail.bundle exec rake(tests + standard): green locally (Ruby 4.0.6).Upgrade
Run
cap <stage> solid_queue:installagain so the installed unit runsbin/jobs.🤖 Generated with Claude Code