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

Handling redployments #107

Closed
tomchristie opened this issue Oct 24, 2016 · 2 comments
Closed

Handling redployments #107

tomchristie opened this issue Oct 24, 2016 · 2 comments

Comments

@tomchristie
Copy link
Contributor

Hiya,

One thing that's not clear to me from the documentation is how users should be expected to handle app redeployments (without dropping existing connections). Presumably you'd need to bring up the new servers on a different port, switch the load balancer, and then (gracefully) stop the existing server.

  • Does sanic handle graceful redeployment without dropping connections?
  • Have I misunderstood how app redeployment should be handled with sanic?
  • Would this be worth documenting in the deployment section.

(Also related to #61 since graceful reloads are one of the benefits of running an application framework underneath a server such as gunicorn.)

@channelcat
Copy link
Contributor

channelcat commented Oct 25, 2016

Hmm, Sanic is set up to properly drain connections on close, but does not support reloading, so you would have to do what you outlined. Looking at Gunicorn, it looks like it creates an arbiter before loading any application code. To create workers, the arbiter forks the process first, then initializes the application code to allow graceful reloading. Pretty neat.

We should be able to support that paradigm by shifting to running apps with python -m sanic file.app (currently supported) when using multiple workers. I think I'd like to add this, but I'm not sure when I will be able to get to it, so I'm tagging in case someone else wants to pick it up first :).

@stale
Copy link

stale bot commented May 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

@stale stale bot added the stale label May 15, 2019
@stale stale bot closed this as completed Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants