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

2369 graceful shutdown of signal handlers #2444

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

theconsolelogger
Copy link

Issue: #2369

This PR makes two key changes:

  • It names signal handler asyncio.Tasks "signal" so that they are distinguishable from other asyncio.Tasks that are running in the event loop.
  • It cancels running signal handler asyncio.Tasks when sanic is stopped.

@theconsolelogger theconsolelogger requested a review from a team as a code owner May 1, 2022 10:56
@@ -192,7 +192,7 @@ async def dispatch(
if inline:
return await dispatch

task = asyncio.get_running_loop().create_task(dispatch)
task = asyncio.get_running_loop().create_task(dispatch, name="signal")
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should add a more descriptive name? Also include the handler __name__?

@ChihweiLHBird ChihweiLHBird linked an issue Jun 19, 2022 that may be closed by this pull request
@ahopkins
Copy link
Member

This does not seem to be working as intended. I am going to hold off on this until next release and try and come up with another solution. If you have other ides, LMK.

@ahopkins ahopkins marked this pull request as draft September 19, 2022 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

Graceful shutdown of signal handlers
3 participants