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

Cancel waiting coroutines before enqueueing the next lazy background task #1104

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

falkoschindler
Copy link
Contributor

This PR fixes issue #1099, which occurred when a new lazy task replaced another one waiting for execution. The replaced coroutine is never awaited, causing a RuntimeWarning. By creating a task and immediately canceling it, the warning does not show up:

asyncio.Task(lazy_tasks_waiting[name]).cancel()

@falkoschindler falkoschindler added the bug Something isn't working label Jun 28, 2023
@falkoschindler falkoschindler added this to the 1.2.24 milestone Jun 28, 2023
@rodja rodja merged commit 4fb2234 into main Jun 28, 2023
7 checks passed
@rodja rodja deleted the lazy-tasks branch June 28, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RuntimeWarning: coroutine 'PersistentDict.backup.<locals>.backup' was never awaited
2 participants