Repository navigation
Let solid_queue:quiet go on when systemctl fails - #10
Merged
Merged
Conversation
solid_queue:quiet demande raise_on_non_zero_exit: false, mais execute_systemd transmettait toujours true depuis la prise en charge de :system (8c774da, v0.1.1), et la branche sudo n'en tenait pas compte : un échec de `systemctl kill` arrêtait le déploiement dès deploy:starting. execute_systemd et sudo_if_needed transmettent maintenant l'option, en mode utilisateur comme en mode :system. Les autres tâches gardent raise_on_non_zero_exit: true. Le projet Capistrano de test passe dans test_helper.rb pour servir aux deux fichiers de test. 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.
Based on #9 (reuses its test Capistrano project).
Problem
solid_queue:quiet(hookafter "deploy:starting") callsexecute_systemd(..., raise_on_non_zero_exit: false)so that a failingsystemctl killdoesn't block the deploy. Since:systemsupport (8c774da, v0.1.1),execute_systemdalways passesraise_on_non_zero_exit: true, and the:systembranch (backend.sudo) ignored the option. A failingsystemctl killtherefore stops the deploy atdeploy:starting.Changes
lib/capistrano/solid_queue.rb:execute_systemdpasses the option it receives tosudo_if_needed, which also passes it tobackend.sudo(Capistrano's DSLsudorunsexecute :sudo, *args, so it accepts the options ofexecute).start,stop,restart…) keepraise_on_non_zero_exit: true.test/test_helper.rb(CapistranoProject#run_cap) so both test files can use it.Tests
test/capistrano/test_systemctl_failure.rbrunscap preprod <task>in the test project (SSHKitLocalbackend), withsystemctl(orsudoin:systemmode) replaced byfalsethroughSSHKit.config.command_map:solid_queue:quietin user mode →capsucceeds (failed without the fix:/bin/systemctl exit status: 256);solid_queue:quietin:systemmode →capsucceeds (failed without the fix:sudo exit status: 256);solid_queue:stop→capfails withSSHKit::Command::Failed: /bin/systemctl exit status.Mutation: putting
trueback inexecute_systemdmakes bothquiettests fail; removing the option frombackend.sudomakes the:systemtest fail.bundle exec rake(tests + standard): green locally (Ruby 4.0.6).🤖 Generated with Claude Code