Issue a warning when coroutine is never awaited
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
Following #3588, coroutines should issue a warning when they are never awaited, to mimic Python coroutine behavior.
However, the best place to put this warning seems to be in __del__, so it would requires #2479 before.
"Never awaited" means (for Python coroutines) that the coroutine has not been polled at least once. Regarding current coroutine implementation, it means that waker field is still None when __del__ is executed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the coroutine implementation and its del path, then review issue #2479 for the required prerequisite. The work is done when an unpolled coroutine, identified by waker still being None, emits a warning on destruction while a coroutine polled at least once does not.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100