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

Occasional "coroutine xxx was never awaited" warnings #77

Open
rjwills28 opened this issue Jun 22, 2023 · 0 comments
Open

Occasional "coroutine xxx was never awaited" warnings #77

rjwills28 opened this issue Jun 22, 2023 · 0 comments
Assignees

Comments

@rjwills28
Copy link
Collaborator

Occasionally I see the following RuntimeWarnings printed to the terminal running Coniql:

/usr/local/lib/python3.8/asyncio/events.py:81: RuntimeWarning: coroutine 'ExecutionContext.execute_fields.<locals>.get_results' was never awaited
  self._context.run(self._callback, *self._args)
Object allocated at (most recent call last):
  File "/xxx/lib/python3.8/site-packages/graphql/execution/execute.py", lineno 456
    return get_results()
/usr/local/lib/python3.8/asyncio/events.py:81: RuntimeWarning: coroutine 'ExecutionContext.execute_field.<locals>.await_result' was never awaited
  self._context.run(self._callback, *self._args)
Object allocated at (most recent call last):
  File "/xxx/lib/python3.8/site-packages/graphql/execution/execute.py", lineno 540
    return await_result()
/usr/local/lib/python3.8/asyncio/events.py:81: RuntimeWarning: coroutine 'GraphQLCoreConverter.from_resolver.<locals>._async_resolver' was never awaited
  self._context.run(self._callback, *self._args)
Object allocated at (most recent call last):
  File "/xxx/lib/python3.8/site-packages/graphql/execution/execute.py", lineno 521
    result = resolve_fn(source, info, **args)

This is reproducible by running a client (e.g. cs-web-proto) displaying ~20 PVs updating at 10Hz and then closing or refreshing that webpage. This means that warning are coming during the clean up of subscriptions when the websocket is closed by the client. It only happens occasionally but a few attempts of refreshing usually works to reproduce it

The warning is coming from the underlying graphql package (not a direct dependency of Coniql). It suggests that a some asyncio task is being scheduled but does not get run. I think it must be some sort of timing issue as we don't always see it and in most cases the clean up / cancelling of a task occurs without any warnings.

It doesn't seem to impact behaviour or performance but it would be nice to know why it sometimes occurs.

@rjwills28 rjwills28 self-assigned this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant