-
-
Notifications
You must be signed in to change notification settings - Fork 24
Major rework of shutdown and reconnect logs to avoid zombie tasks and race conditions #117
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
Merged
aikaterna
merged 14 commits into
Cog-Creators:develop
from
Drapersniper:Improve_shutdowns_reconnects
Mar 20, 2022
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
af0085e
Major rework of shutdown and reconnect logs to avoid zombie tasks and…
Drapersniper d661242
depends
Drapersniper e6d8e3f
cleanup nodes
Drapersniper 4e8d156
rename vars
Drapersniper 6da2ca1
missing callbacks
Drapersniper 27c4b47
add a `wait_until_ready` to `lavalink`
Drapersniper d32dd7b
change order to avoid circular imports
Drapersniper 789f3c8
*sigh*
Drapersniper 71686ef
uhh
Drapersniper 4cdcea7
ensure volume persists on a resume
Drapersniper 44b4ce8
formatting
Drapersniper 5980294
revert task callbacks
Drapersniper 810538e
Apply suggestions from code review
Drapersniper 5954cee
Update lavalink/node.py
Drapersniper 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,4 +51,5 @@ | |
| "AbortingNodeConnection", | ||
| "NodeNotReady", | ||
| "PlayerNotFound", | ||
| "wait_until_ready", | ||
| ] | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,6 @@ | ||
| import asyncio | ||
| import contextlib | ||
|
|
||
| from .log import log | ||
|
|
||
|
|
||
| def format_time(time): | ||
| """Formats the given time into HH:MM:SS""" | ||
| h, r = divmod(time / 1000, 3600) | ||
| m, s = divmod(r, 60) | ||
|
|
||
| return "%02d:%02d:%02d" % (h, m, s) | ||
|
|
||
|
|
||
| def task_callback_exception(task: asyncio.Task) -> None: | ||
| with contextlib.suppress(asyncio.CancelledError, asyncio.InvalidStateError): | ||
| if exc := task.exception(): | ||
| log.exception("%s raised an Exception", task.get_name(), exc_info=exc) | ||
|
|
||
|
|
||
| def task_callback_debug(task: asyncio.Task) -> None: | ||
| with contextlib.suppress(asyncio.CancelledError, asyncio.InvalidStateError): | ||
| if exc := task.exception(): | ||
| log.debug("%s raised an Exception", task.get_name(), exc_info=exc) | ||
|
|
||
|
|
||
| def task_callback_verbose(task: asyncio.Task) -> None: | ||
| with contextlib.suppress(asyncio.CancelledError, asyncio.InvalidStateError): | ||
| if exc := task.exception(): | ||
| log.verbose("%s raised an Exception", task.get_name(), exc_info=exc) | ||
|
|
||
|
|
||
| def task_callback_trace(task: asyncio.Task) -> None: | ||
| with contextlib.suppress(asyncio.CancelledError, asyncio.InvalidStateError): | ||
| if exc := task.exception(): | ||
| log.trace("%s raised an Exception", task.get_name(), exc_info=exc) | ||
| return f"{h:02d}:{m:02d}:{s:02d}" |
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.
Uh oh!
There was an error while loading. Please reload this page.