You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
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 :).
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.
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.
(Also related to #61 since graceful reloads are one of the benefits of running an application framework underneath a server such as gunicorn.)
The text was updated successfully, but these errors were encountered: