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

add graceful timeout when shutdown #815

Merged
merged 6 commits into from
Jul 8, 2017
Merged

add graceful timeout when shutdown #815

merged 6 commits into from
Jul 8, 2017

Conversation

yunstanford
Copy link
Member

Fix for #810

We should add graceful_shutdown_timeout, in case it hangs forever when we deploy the service.

There is an example in the issue page (#810) for reproducing.

This PR includes,

  1. fix for serve
  2. fix for gunicorn worker
  3. unit test

else:
conn.close()

_shutdown = asyncio.gather(*coros, loop=loop)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when coros is empty here?

Copy link
Member Author

@yunstanford yunstanford Jun 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested that as well. It doesn't matter. you can also have a try.

i think next line loop.run_until_complete(_shutdown) just finishes immediately if coro is empty.

@yunstanford
Copy link
Member Author

Any feedback ? or can we merge this in ?

Copy link
Contributor

@r0fls r0fls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@r0fls r0fls merged commit f0a9564 into sanic-org:master Jul 8, 2017
@seemethere seemethere modified the milestone: 0.6.0 Jul 26, 2017
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.

4 participants