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

replace gen.coroutine usage with async def #6221

Open
graingert opened this issue Apr 27, 2022 · 1 comment · May be fixed by #6262
Open

replace gen.coroutine usage with async def #6221

graingert opened this issue Apr 27, 2022 · 1 comment · May be fixed by #6262
Assignees
Labels
asyncio hygiene Improve code quality and reduce maintenance overhead

Comments

@graingert
Copy link
Member

graingert commented Apr 27, 2022

most functions that use @gen.coroutine were upgraded in #3706 #3242 #2934 and #2871 however there's still a few left

notably

@gen.coroutine
def close(self):
# We use gen.coroutine here rather than async def to avoid errors like
# Task was destroyed but it is pending!
# Triggered by distributed.deploy.tests.test_local::test_silent_startup

this Task was destroyed but it is pending! warning message is due to loop.stop() being called before all the tasks are finished. When using asyncio.run all tasks are cancelled and the loop only stops when all the tasks are finished and so this error should no longer happen.

see also #3245

Soft blocked by: Usage of asyncio.run

@sjperkins sjperkins linked a pull request May 3, 2022 that will close this issue
2 tasks
@fjetter fjetter added asyncio technical-debt hygiene Improve code quality and reduce maintenance overhead and removed technical-debt labels May 25, 2022
@fjetter
Copy link
Member

fjetter commented Jun 13, 2022

Blocked by #6163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asyncio hygiene Improve code quality and reduce maintenance overhead
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants