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

LoopCommunicator: RuntimeWarning: coroutine 'create_task.<locals>.run_task' was never awaited #211

Open
chrisjsewell opened this issue Feb 26, 2021 · 1 comment

Comments

@chrisjsewell
Copy link
Member

chrisjsewell commented Feb 26, 2021

I've seen this quite a few times now in unit tests, for example in aiidateam/aiida-core#4775 (comment)
This coroutine is created in plumpy.futures.create_task, which is called by plumpy.communicator.convert_to_comm, that is used when adding an rpc/task/broadcast subscriber in plumpy.communicator.LoopCommunicator.

It is weird that it should say it was not awaited, because it is wrapped in asyncio.run_coroutine_threadsafe(run_task(), loop), so you would think that it should always be awaited.

Is this just because the loop is closed while run_task() is running (I guess these tasks should run forever until the subscriber is removed), or does it point to a deeper problem?
Could LoopCommunicator.close ensure such tasks are stopped gracefully, e.g. by ensuring all subscribers are removed.

cc @unkcpz

@unkcpz
Copy link
Member

unkcpz commented Feb 26, 2021 via email

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

No branches or pull requests

2 participants