flupke / rainbow-saddle

A wrapper around gunicorn to handle graceful restarts correctly
48 stars 12 forks source link

Old master need to be turned off only after new master is ready to work #6

Closed rfloriano closed 8 years ago

rfloriano commented 8 years ago

If WSGI Application for some reason delay to start, old master is killed by rainbow-saddle before new master is ready to work. Django Framework a example, WSGI Application is loaded, but Django is ready to work only after the first request.

To maintain graceful shutdown using USR2 signal, rainbow-saddle can keep old gunicorn master running until the new gunicorn master is ready to work. Multiple HUP signal sequentially can be a problem in this case, so a queue was implemented to solve it, if one HUP is being processed, news HUPs will be putted in a queue and after processed HUP, the next (last) HUP will be processed in main loop.

flupke commented 8 years ago

First of all thank you very much for your work, and sorry for the late reply, I'm in vacations.

The code looks good to me, but there are conflicts and I can't resolve them until next week because I don't have my laptop with me.

rfloriano commented 8 years ago

You're welcome @flupke.

No problem, I will wait. I'm patient. :) Thanks for your reply.

flupke commented 8 years ago

I merged your PR, made a new release on pypi (0.3.0), and added a basic functional test.

Thanks again!

rfloriano commented 8 years ago

Thank you! :D