Merged
Conversation
…ents to prevent deadlocks
Contributor
Author
|
Equivalent demo with quart from quart import Quart
app = Quart(__name__)
@app.route('/')
async def hello():
return 'hello'
@app.before_serving
async def create_db_pool():
print("running quart startup 1")
@app.before_serving
async def use_g():
print("Run quart startup 2")
@app.while_serving
async def lifespan():
print("Initial startup")
yield
print("Shutting down quart")
@app.after_serving
async def create_db_pool():
print("running quart shutdown 1") |
…ent loops are used. Check call sequence at runtime
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #187 +/- ##
==========================================
- Coverage 93.35% 92.97% -0.39%
==========================================
Files 56 56
Lines 3116 3187 +71
Branches 633 649 +16
==========================================
+ Hits 2909 2963 +54
- Misses 128 137 +9
- Partials 79 87 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Contributor
Author
YunchuWang
reviewed
Nov 7, 2023
|
|
||
| def __del__(self): | ||
| if self.startup_task_done: | ||
| asyncio.run(self.middleware.notify_shutdown()) |
Member
There was a problem hiding this comment.
curious why for shutdown, we dont raise runtimeerror if shutdown does not succeed (similar to startup)?
YunchuWang
approved these changes
Nov 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR calls the lifecycle event for startup and shutdown for an ASGI application provided by the new V2 wrapper.
This FastAPI application:
And this
function_app.pycode:Will run the startup and shutdown events for the Functions worker process.
