Option to kill other resque-pool instances on startup#137
Option to kill other resque-pool instances on startup#137nevans merged 2 commits intoresque:masterfrom
Conversation
Adds the `--kill-others` command line option. When this option is set, resque-pool will send a graceful shutdown signal to all other running resque-pools. This is useful in "no downtime deploy" scenarios, where you want the pool running the new code to completely load its environment and be ready to process work *before* shutting down the old code. Once the new code is ready, it will shut down the old processes for you. See also resque#132
|
|
|
That is a good point. Although, I think you could run multiple instances with pidfiles by specifying different pidfile paths. Probably not a common scenario, but maybe enough to not force the |
This explains functionality from resque#132 and resque#137 and provides example upstart config files that will allow for zero-downtime deploys.
This explains functionality from resque#132 and resque#137 and provides example upstart config files that will allow for zero-downtime deploys.
|
I very much like the idea of defaulting |
lib/resque/pool/killer.rb
Outdated
There was a problem hiding this comment.
This ought to always work just fine on Linux/Mac OS X/BSD... but my paranoia prefers to use ps -e -o pid= -o command= (POSIX flags, restricted output columns). Your current parse_pids_from_output should work just fine on either, I think.
Specify the output columns for the `ps` command. Only match process commands that start with `resque-pool-master`
67c59db to
af0d024
Compare
|
What if we add an additional flag that encompasses the many options that work together for this approach? For example, we could add --min-downtime (or --max-uptime), which sets --kill-others, --no-pidfile and --lock. That might be more discoverable than having --kill-others imply all of those options. I like the idea of having discrete flags that do one thing, but also a flag to group the flags commonly used together. |
|
I'm okay with that approach. I think I prefer |
Adds the
--kill-otherscommand line option.When this option is set, resque-pool will send a graceful
shutdown signal to all other running resque-pools.
This is useful in "no downtime deploy" scenarios,
where you want the pool running the new code to
completely load its environment and be ready to
process work before shutting down the old code.
Once the new code is ready, it will shut down the
old processes for you.
See also #132