Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should quit_excess_workers_for() respect TERM_CHILD setting? #172

Open
iceberg901 opened this issue Feb 25, 2019 · 1 comment
Open

Should quit_excess_workers_for() respect TERM_CHILD setting? #172

iceberg901 opened this issue Feb 25, 2019 · 1 comment

Comments

@iceberg901
Copy link

Is it necessary to send a different signal in quit_excess_workers_for when TERM_CHILD=1 is set to ensure clean shutdown of workers under Heroku signal handling conditions? Currently it always sends QUIT

    def quit_excess_workers_for(queues)
      delta = -worker_delta_for(queues)
      pids_for(queues)[0...delta].each do |pid|
        Process.kill("QUIT", pid)
      end
    end
@nevans
Copy link
Collaborator

nevans commented Mar 18, 2019

That sounds very reasonable to me.

It's certainly the approach used by graceful_worker_shutdown_and_wait! and graceful_worker_shutdown!, although shutdown_everything_now! is reversed (which is confusing, but based on the default CLI options which will use graceful_worker_shutdown_and_wait when TERM_CHILD is enabled).

Send a small PR, and I'll merge it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants