-
-
Notifications
You must be signed in to change notification settings - Fork 729
Properly await coroutines registered with app.on_shutdown #4641
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
Open
rodja
wants to merge
60
commits into
main
Choose a base branch
from
pytest-warnings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+268
−56
Open
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
8ad812f
ignore warnings from upstream packages in pytest
rodja 97bf33c
screen tests should not be async
rodja ebf0878
write backup synchronously if we do not have an event loop
rodja a9e78dd
rewrite deprecated utcfromtimestamp
rodja 4cc1def
make utc compatible with lower python versions
rodja 8955ff9
improve naming and simplify coroutine closing
rodja d6010f9
register storage.on_shutdown at startup not in app.__init__
rodja 562ed11
clean up all sheduled coros and tasks on shutdown
rodja cd5b7c1
properly cancel remaining background tasks on shutdown
rodja 2ef1095
fix typing by ensuring we always store coroutines
rodja 2d20265
make sure list is not modified while iterating
rodja 9a35eba
do not cancel our own shutdown
rodja 52bf435
show test output when it happens
rodja af9b967
await app stopping on shutdown
rodja cafeff4
reactivate clean test output
rodja 6cc0288
better naming
rodja f9936fa
wait for all tasks to complete within time limit
rodja 03922f2
name background tasks where ever possible
rodja 7967bfe
only stop for unexpected ERROR logs
rodja 0648f54
increase execution limit to ensure tests do not get aborted if github…
rodja 3731875
give the loop opportunity to cancel all tasks before stopping
rodja 89afe58
cleanup
rodja 0fdb23b
fix typing
rodja 9b74daa
fix background task name
rodja f09e1a3
break on cancellation
rodja 714f227
formatting
rodja fc058f0
do not cancel ongoing backups
rodja c8419bb
only execute user simulation tests for now
rodja 2b4f4e0
introduce wait-for2 package to properly handle cancellation
rodja 83dfe7b
replace all asyncio.wait_for with wait_for2
rodja deb1e36
mypy ignore wait_for2 module
rodja 50782f9
properly cancel all tasks and wait for storage tasks
rodja 78eb0ca
fix wait_for call
rodja 6ab210e
reactivate all tests
rodja e3d4b56
more generic way to mark functions to be awaited on shutdown (instead…
rodja 2987f5e
add some minimal documentation
rodja 6c8af39
use public coro accessor
rodja fb8a956
fix mypy issue and reorganize
rodja c516d03
fix "leaked semaphore" warnings as hinted in #4131
rodja 04bd6d3
prevent mypy warning
rodja d8f1c88
use existing multiprocessing import
rodja c4e8425
Revert "use existing multiprocessing import"
falkoschindler f514c66
Revert "prevent mypy warning"
falkoschindler ff1257a
Revert "fix "leaked semaphore" warnings as hinted in #4131"
falkoschindler c079949
Revert "increase execution limit to ensure tests do not get aborted i…
falkoschindler 14a6536
isolate usage of wait_for2 for easier removal in Python 3.13
falkoschindler 5732f97
make sure to run shutdown handlers in auto-index context
falkoschindler d3f5650
revert renaming to avoid breaking changes
falkoschindler 353dbca
fix type annotation
falkoschindler 6dc2d75
Merge branch 'main' into pytest-warnings
falkoschindler 32b6b03
minor cleanup
falkoschindler deb5f87
code review
falkoschindler 049a1bf
convert code snippets into an interactive demo
falkoschindler 27a0f0d
rewrite @await_on_shutdown to not produce memory leaks
rodja b48ba1a
write backup with aiofiles
rodja cafbf4b
Revert "rewrite @await_on_shutdown to not produce memory leaks"
rodja 323490e
use weakSet
rodja 247a276
Merge branch 'main' into pytest-warnings
falkoschindler 0fc1d92
cleanup
rodja 9d4a001
add test to demonstrate problem with click handler
rodja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this possible?