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

Attempt to kill workers once per request #18

Merged
merged 5 commits into from
Mar 15, 2013
Merged

Attempt to kill workers once per request #18

merged 5 commits into from
Mar 15, 2013

Conversation

jclem
Copy link
Collaborator

@jclem jclem commented Mar 12, 2013

This proposed change attempts to kill workers once per request. The reason for this is that the QUIT signal tells a Unicorn worker to shut down gracefully. Previously, WorkerKiller.kill_self would send the QUIT signal, then tell the worker to loop until it died. This loop prevented graceful shutdowns of the worker.

My first solution for this was to either fork the process (or use a Thread) and call Process.kill :QUIT, worker_pid from there, but this solution seems more elegant. In general Unicorn workers are good about gracefully shutting down when they receive a QUIT (is there significant evidence of them not?), so this solution attempts to send a QUIT first, and then escalates from there on each following request.

It's a somewhat significant change and a version bump, so I thought I'd open it for discussion briefly before merging and releasing.

@markpundsack
Copy link
Contributor

Is it going to work with apps that are otherwise not threadsafe?

jclem added a commit that referenced this pull request Mar 15, 2013
Attempt to kill workers once per request
@jclem jclem merged commit 2aff807 into master Mar 15, 2013
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

Successfully merging this pull request may close these issues.

None yet

2 participants