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

coroutine 'HN.item' was never awaited warning if quitting while loading #26

Closed
davep opened this issue Mar 1, 2024 · 0 comments · Fixed by #27
Closed

coroutine 'HN.item' was never awaited warning if quitting while loading #26

davep opened this issue Mar 1, 2024 · 0 comments · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@davep
Copy link
Owner

davep commented Mar 1, 2024

[I think this only shows if using Python 3.12, but it's an untidy thing regardless]

If you fire up oshit and then escape out while the initial list of items is still loading, you'll see something like this:

/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py:1970: RuntimeWarning: coroutine 'HN.item' was never awaited
  handle = self._ready.popleft()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

At first glance I imagine the issue is that Items._load is getting cancelled (it's an async worker), which in turn means that the requests that are still sat in the queue are getting abandoned, thus being left unawaited. Pragmatically this isn't a problem, we're fine with this. Technically though those corountines sat in semaphore-protected gather should be cancelled somehow, as the app quits.

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 a pull request may close this issue.

1 participant