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

"Task was destroyed but it is pending!" #301

Open
mhchia opened this issue Sep 18, 2019 · 2 comments
Open

"Task was destroyed but it is pending!" #301

mhchia opened this issue Sep 18, 2019 · 2 comments

Comments

@mhchia
Copy link
Contributor

mhchia commented Sep 18, 2019

We get this kind of exceptions in many places in the tests, actually too many. It is because tasks are not tear down properly. We should revisit places where create new tasks and add proper exception handling logics.

RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending coro=<Queue.get() done, defined at /Users/mhchia/.pyenv/versions/3.7-dev/lib/python3.7/asyncio/queues.py:150> wait_for=<Future cancelled>>
@moshemalawach
Copy link
Contributor

Also getting it when I use the timeout feature of asyncio, like this:

await asyncio.wait_for(host.new_stream(peer_id, [PROTOCOL_ID]), connect_timeout)

@ShadowJonathan
Copy link
Contributor

We're planning to switch to trio (#174) or anyio (#383), the latter of which implements a pytest plugin, maybe it's a good time to revisit this issue when or while the change is underway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants